#include #include using namespace std; typedef long long LL; int main(int argc, char* argv[]) { LL N; cin>>N; LL x1=N*2; LL x2=N; N/=2; while (N>0){ x2+=N; N/=2; } LL ans=x2-x1; if (ans<0){ ans=-ans; } cout<