#include using namespace std; long N,x; main() { cin>>N; long t=N; while(t) { if(t%2)x=x*2+1; t/=2; } cout<