#include using namespace std; int main(){ string N; cin >> N; reverse(N.begin(),N.end()); N += '0'; reverse(N.begin(),N.end()); int A = 0; int M = N.size(); A += N[M-2]-'0'; A *= 10; A += N[M-1]-'0'; if(A%2 == 1){ if(N == "01") cout << -1 << endl; else cout << 1 << endl; } else if(A%4 == 0){ if(N == "04") cout << -1 << endl; else cout << 1 << endl; } else cout << -1 << endl; }