#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define F1(x,y,z) for(int x=y;xz;x--) #define F4(x,y,z) for(int x=y;x>=z;x--) #define pb push_back #define LL long long #define co complex #define MAX 100005 #define AMAX 1500 #define MOD 1000000007 #define f(c,d) ((1<<(c))*(d)) using namespace std; LL n,ta,tb; set x; int main(){ while(scanf("%I64d",&n)==1){ ta=tb=0; while(n+1>(1LL<<(ta+1)))ta++; while(n+1>=(1LL<<(tb+1)))tb++; ta++; if(ta==tb)printf("%I64d\n",ta); else{ x.clear(); x.insert(1); F4(a,tb,1){ x.insert(n); n--; ta=(1LL<