import sys input = sys.stdin.readline N=int(input()) #Combi=[[] for i in range(N+1)] #Combi[0]=[1,0] #for i in range(1,N+1): # Combi[i].append(1) # for j in range(i): # Combi[i].append((Combi[i-1][j]+Combi[i-1][j+1])%2) # Combi[i].append(0) #for i in range(N): # print(*Combi[i]) #for i in range(N): # print(sum(Combi[i])) def calc(x): if x==0: return 1 elif x==1: return 2 for i in range(60,-1,-1): if x>=(1<