x=1 A=set() for y in range(1,100): x*=y if x>100: break A.add(x) N=int(input()) if N in A: print(1) else: print(0)