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