#include using namespace std; int main(){ long a,b,c;cin>>a; b=(int)(a/2)*2+a; c=a/2; while(c!=0){a+=c;c/=2;} cout<