#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.14159265359; ll inf=80010010; ll mod=1000000007; int main(){ string s; cin >> s; ll n; if (s.size()<18) { n=stoll(s); }else{ if ((s[s.size()-1]-'0')%2) { n=5; }else{ string t; t.push_back(s[s.size()-3]); t.push_back(s[s.size()-2]); t.push_back(s[s.size()-1]); ll x=stoll(t); if (x%4==0) { n=1; }else{ n=5; } } } if (n%2) { if (n==1) { cout << -1 << endl; return 0; } cout << 1 << endl; }else if ((n/2)%2||n==4) { cout << -1 << endl; }else{ cout << 1 << endl; } }