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