#include using namespace std; //#include //using namespace atcoder; using ll=long long; using Graph=vector>; #define MAX 1000000 #define MOD 1000000007 //#define INF 1000000000 #define INF 1000000000000000000 int main(){ ll D; cin>>D; //cout<<(D+2)/2< pow2(60); vector sum(60); for(int i=0;i<60;i++){ pow2[i]=1LL<=0;j--){ if(d>=sum[j]){ d-=sum[j]; x+=pow2[j]; } } if(d==0){ ans=min(ans,x); } } cout<