n = int(input()) ans = ( 'INF' if n <= 2 else 6 if n == 3 else 6 if n == 4 else 4 if n <= 6 else #3 if n <= 9 else 2 ) print(ans)