/** * @FileName a.cpp * @Author kanpurin * @Created 2020.08.29 15:23:20 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { string s;cin >> s; if (s.size() == 1) { int t = s[0] - '0'; if (t >= 3 && (t % 2 == 1 || t == 8)) { puts("1"); } else { puts("-1"); } } else { int t = s[s.size()-1] - '0' + (s[s.size()-2] - '0') * 10; if (t % 4 == 0 || t % 2 == 1) { cout << 1 << endl; } else { cout << -1 << endl; } } return 0; }