#include <bits/stdc++.h> using namespace std; #define all(a)a.begin(),a.end() using ll=long long; const int INF = 1<<30; const ll INFll =1LL<<62; const int mod= int(1e9)+7; //const int mod=998244353; using P = pair<int,int>; using Pll = pair<ll,ll>; using ld=long double; int main() { string s;cin >>s; reverse(all(s)); int k=(s[0]-'0'); if(s.size()==1){ if(k==4){ cout <<-1<<endl; return 0; } if(k==1){ cout <<-1<<endl; return 0; } } int n=(s[0]-'0')+(s[1]-'0')*10; if(n%4==0||(s[0]-'0')%2==1)cout <<1<<endl; else cout <<-1<<endl; }