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