#include<iostream>
using namespace std;
int main(){
int N;
cin>> N;
int rotated = ((N << 1) & 0×ff)|(N>>7);
cout<<rotated;
return 0;
}