#include #include #include #include #include #include #include #include #include using namespace std; using ll = int64_t; #define rep(i, j, n) for (int i = j; i < (int)n; ++i) #define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i) int main() { string s; cin >> s; if (s.size() > 16) cout << -1 << endl; else { ll n = atoll(s.c_str()); ll i = 1; while (i * i <= n) { if (n % i == 0) { ll c = i; ll d = n / i; if ((c + d) % 2 == 0) { cout << 1 << endl; return 0; } } i++; } } cout << -1 << endl; return 0; }