N=int(input()) if N>6: print(2) elif N==2: print('INF') elif N==3: print(6) else: X=[0,0,0,0,6,4,4] print(X[N])