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