#include<iostream>
using namespace std;
int main(){
    int N;
    cin>>N;
    if(N>=0&& N<=255){
        int rotated_value=((N<<1)/(N>>7))&225;
        cout<<rotated vlaue<<endl;
    }
    else{
        cout<<"INPUT IS OUT OF THE VALID RANGE [0,225]."<<endl;
    }
    return 0;
}