#include <stdio.h>
int main(){
    int N;
    scanf("%d",&N);
    int rotated=((N<<1)|(N>>7))&OxFF;
    printf("%d",rotated);
    return 0;
}