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