N = input() if len(N) == 1: n = int(N) if n > 1 and (n % 2 == 1 or n % 4 == 0): print(1) else: print(-1) else: n = int(N[-2:]) if n % 2 == 1 or n % 4 == 0: print(1) else: print(-1)