#include //#include //using namespace atcoder; using namespace std; using ll = long long; ll cnt(ll x){ ll res = 0; while(x){ res += x&1; x/=2; } return res; } int main(){ ll n; cin >> n; if(cnt(n)==1){ cout<>i&1LL){ n -= 1LL<