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