#include using lint=long long; using real=long double; void cmn(lint&x,lint y){if(x>y)x=y;} int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint inf=std::numeric_limits::max(); lint n,N;std::cin>>n;N=1ll<g(n),a(n),dp(N,inf); for(lint i=0;i>x; if(x&1)g.at(i)|=1ll<>x; dp.at(0)=0; for(lint bs=0;bs>i&1)continue; cmn(dp.at(bs|1ll<