#include using namespace std; using ll = long long; int main(){ string s; cin >> s; int n = s.size(); int m = s[n-2]*10+s[n-1]; if(n==1 && s[0]-'0'==4){ cout << -1 << endl; return 0; } if(n==1 && s[0]-'0'==1){ cout << -1 << endl; return 0; } if(m%2==0 && m%4!=0){ cout << -1 << endl; return 0; }else{ cout << 1 << endl; return 0; } }