#include #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") using namespace std; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); long long N; cin >> N; int cnt = 0; for(int i = 0; i < 60; i++) { cnt += (N >> i & 1 ? 1 : 0); } if(cnt == 1) { cout << 0 << '\n'; } else { long long ans = 1; for(int i = 1; i < cnt; i++) { ans *= 2; } cout << ans << '\n'; } return 0; }