#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n;
  cin >> n;
  n = n - ((n / 360) * 360);
  n = -n;
  if (n < 0) {
    n = n + 360;
  }
  long long int AnswerTurns = 0;
  long long int MindeviationFromVertical;
  MindeviationFromVertical = min(360 - n, n - 0);
  long long int TempDeviation;
  for (long long int i = 0; i <= 3; i++) {
    long long int Hold = n + (90 * i);
    if (Hold > 360) {
      Hold -= 360;
    }
    if (min(360 - Hold, Hold - 0) < MindeviationFromVertical) {
      MindeviationFromVertical = min(360 - Hold, Hold - 0);
      AnswerTurns = i;
    }
  }
  cout << AnswerTurns;
  return 0;
}
