def divisor(n): d = [] i = 1 while i * i <= n: if n % i == 0: d.append(i) i += 1 return d n = int(input()) d = divisor(n) ans = -1 for small in d: big = n // small if (big - small) % 2 == 0: if 0 < big - (big - small) // 2: ans = 1 break print(ans)