#include using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int main() { string N; cin >> N; reverse(N.begin(), N.end()); vector D; for (char c : N) D.push_back(c - '0'); while (D.size() < 10) D.push_back(0); int ans = 0; if (D[0] % 2 == 1) { if (N == "1") ans = -1; else ans = 1; } else { int d = D[0] + D[1] * 10; if (N == "4") ans = -1; else if (d % 4 == 0) ans = 1; else ans = -1; } cout << ans << endl; return 0; }