#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:100000000")
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
int main() {
  long long n;
  cin >> n;
  n *= -1LL;
  n %= 360LL;
  n += 360LL;
  n %= 360LL;
  int minval = min(abs(n % 360 - 360), n);
  int cnt = 0;
  for (int i = 1; i <= 4; i++) {
    int val =
        min(abs((n + (i)*90 + 360) % 360 - 360), (n + (i)*90 + 360) % 360);
    if (val < minval) cnt = i, minval = val;
  }
  cout << cnt << endl;
  return 0;
}
