#include #define REP(i, x, y) for (ll i = x; i <= y; i++) #define BIT(t) (1ll << t) #define PER(i, y, x) for (ll i = y; i >= x; i--) #define vll vector #define vvll vector> #define pll pair #define SIZE(v) ll(v.size()) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); using namespace std; typedef long long ll; // ios::sync_with_stdio(false); // cin.tie(nullptr); int main(){ ll n; cin >> n; ll ans = 1; REP(i,1,128){ ans *= 2; ans %= n; } cout << ans << endl; }