#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ll n;
  cin >> n;
  n %= 360;
  if (n < 0)
    n = abs(n);
  else
    n = 360 - n;
  int best = 360;
  int idx = 0;
  for (int i = 0; i < 4; i++) {
    int x = min((n + 90 * i) % 360, abs(360 - (n + 90 * i) % 360));
    if (x < best) {
      best = x;
      idx = i;
    }
  }
  cout << idx << '\n';
  return 0;
}
