#include using namespace std; int main() { int64_t m; cin >> m; int64_t tmp = 1; for(int i = 0; i < 128; ++i) { tmp <<= 1ll; tmp %= m; } cout << tmp << '\n'; return 0; }