n = int(input()) if (n & (n - 1)) == 0: print("INF") else: print(n - 1)