#include using namespace std; using ll=long long; int main(){ ll X; cin>>X; if(__builtin_popcountll(X^1)==1){ cout<<(X^1)<