#include using namespace std; int main() { long N = 1, M; cin >> M; for (int i = 0; i < 128; i++) (N *= 2) %= M; cout << N << "\n"; }