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