#include #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--) #define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++) #define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--) #define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++) #define ALL(x) x.begin(), x.end() using ll = long long; using namespace std; int fc(string n){ int res = 0; reverse(ALL(n)); rep(i, n.size()){ res *= 10; res += n.at(i) - '0'; res %= 4; } return res; } int main(){ string n; cin >> n; if(n.size() < 8){ int ni = stoi(n); bool a1 = (ni % 2 == 1 && ni != 1); ni -= 8; bool a2 = (ni >= 0 && ni % 4 == 0); if(a1 || a2) cout << 1 << endl; else cout << -1 << endl; }else{ int ni = fc(n); if(ni % 2 == 1 || ni % 4 == 0) cout << 1 << endl; else cout << -1 << endl; } return 0; }