import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.set_int_max_str_digits(10**7) L = int(read()) if L == 2: print(3) print('INF') exit() def fibonacci(n): # x^n = a + bx mod x^2-x-1 if n == 0: return 1, 0 a, b = fibonacci(n // 2) c = b * b a, b = a * a + c, 2 * a * b + c return (b, a + b) if n & 1 else (a, b) _, x = fibonacci(L) if L % 2 == 0: _, y = fibonacci(L // 2) x -= y * y print(L) print(x)