#include using namespace std; int main(){ string s;cin>>s; if((((s.size()!=1?s[s.size()-2]:'0')-'0')*10+(s[s.size()-1]-'0'))%4 == 2 || s == "1" || s == "4"){ cout << -1 << endl; }else{ cout << 1 << endl; } }