N = int(input()) if(N%2 == 1): print(1 if N != 1 else -1) else: print(1 if (N-4)%4 == 0 and N >= 8 else -1)