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