N = int(input()) if int(N**0.5)*int(N**0.5) == N or N % 4 == 2: print(-1) else: print(1)