n = int(input()) if n == 2: print("INF") exit() if n == 4 or n == 6: print(10 - n) exit() print(max(2, 9-n))