n = int(input()) now = 1 did = False for i in range(1, 1000): if (did): break l = 0 r = 10000000000000000000000000 for _ in range(1, 200): m = (l + r) / 2 k = (m + i) * (m + i) - m * m if (k <= n): l = m else: r = m if ((l + i) * (l + i) - l * l == n): print(1) did = True if (did == False): print(-1)