N=int(input()) if N>6: print(2) elif N==2: print('INF') elif N==3: print(6) else: print(9-N)