N = int(input()) for i in range(1,int(N**0.5)+1): if N%i == 0: ABgap = N//i ABsum = i if (ABgap+ABsum)%2 == 0: print(1) exit() print(-1)