#include <bits/stdc++.h>
using namespace std;
int main(){
  string N;
  cin >> N;
  string S;
  if (N.size() >= 2){
    S = N.substr(N.size() - 2);
  } else {
    S = "0" + N;
  }
  int d = stoi(S);
  if (d % 2 == 1 && N != "1"){
    cout << 1 << endl;
  } else if (d % 4 == 0 && N != "4"){
    cout << 1 << endl;
  } else {
    cout << -1 << endl;
  }
}