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