#include #include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000 int main(){ int N; cin>>N; int A = N; int B = 0,C = 0; bool f = true; rep(i,N){ if((N>>i)&1){ if(f)B |= 1<