#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ll d; cin>>d; ll ans=-1; for(int i=60;i>=1;i--){ ll ng=0,ok=1e18+7; while(ok-ng>1){ ll mid=(ng+ok)/2; ll tmp=mid; ll sum=0; bool b=true; rep(j,i){ if(tmp<1) b=false; sum+=tmp; tmp/=2; } if(b==false || sum