#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; const ll MOD = 1000000007; const ll INF = 1e18; #define REP(i, n) for(int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() int main(){ string s; cin >> s; int n=s.size(), a; if(n>=2) a=(s[n-2]-'0')*10+(s[n-1]-'0'); else a=(s[n-1]-'0'); if(a%4==0||a%2==1) cout << 1 << endl; else cout << -1 << endl; return 0; }