#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef pair Pii; const ll mod = 998244353; ll ipow(ll x, ll n) { ll ret = 1; while (n > 0) { if (n & 1) ret = ret * x; x = x * x; n >>= 1; } return ret; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; ll ans = ipow(2, __builtin_popcountll(n) - 1); if (ans == 1) ans = 0; cout << ans << endl; return 0; }