#include #include #include using namespace std; int main(){ int N; string S; cin >> S; N = S.size(); int last2 = stoi(S.substr(max(0, N-2), N)); int last = stoi(S.substr(max(0, N-1), N)); if (last2 % 4 == 0 && (N > 1 || (N == 1 && last > 4))){ cout << 1 << endl; }else if(last % 2 == 1 && last > 1){ cout << 1 << endl; }else{ cout << -1 << endl; } return 0; }