X = 1000000000 print(X) while not int(input()): X = (X + 1) // 2 print(X)