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