N = int(input()) SUM = 1 for i in range(1, 101): SUM *= i if SUM == N: print(1) break elif N < SUM: print(0) break