N = int(input()) now = 1 for i in range(1,100): if(now > N):break if(now == N): print(1) exit() else: now *= i print(0)