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