N=int(input()) k=s=1 while k<64 and s!=N: a,s,i,k=[1]+[2**j for j in range(k)],2**k,0,k+1 while sN])