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