D=int(input()) L=D//2 R=D while L!=R: now=(L+R)//2 count=0 while count0: count+=now now//=2 if count>=D: R=(L+R)//2 else: L=(L+R)//2+1 ok=0 for _ in range(10**5): count=0 now=L while count