def is_power_of_two(n): return (n & (n - 1)) == 0 and n != 0 n = int(input()) if is_power_of_two(n): print("INF") else: print(n - 1)