import sys input = sys.stdin.readline N=int(input()) ANS=["INF","INF","INF",6,5,4,3] if N<=6: print(ANS[N]) else: print(2)