N = int(input()) ans = (N**2 - (N-1)**2)**0.5 if (ans-int(ans)) == 0: print(2) else: print(0)