N=int(input()) if N in [1,2,6,24]: print(1) else: print(0)