#include using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); long long int res = 1; long long int M; cin >> M; for(int i=0;i<128;i++) { res*=2; res%=M; } cout << res << '\n'; return 0; }