import sys input = sys.stdin.readline def getlist(): return list(map(int, input().split())) def main(): n = int(input()) if n == 2: print('INF') return if n <= 4: print(6) return if n <= 6: print(4) return print(2) return if __name__ == '__main__': main()