#include using namespace std; //#include //using namespace atcoder; typedef long long ll; typedef unsigned long long ull; const int MAX = 1e9; const int MIN = -1*1e9; const ll MAXLL = 1e18; const ll MINLL = -1*1e18; //const ll MOD = 998244353; //const ll MOD = 1000000007; int main() { string S; cin >> S; if((S[S.size()-1] - '0')%2 != 0) { cout << 1 << endl; return 0; } reverse(S.begin(),S.end()); if(S.size() != 1) S = S.substr(0,2); reverse(S.begin(),S.end()); cout << (stoi(S)%4==0 ? 1: -1) << endl; return 0; }