#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1061109567;
const long long LINF = 4557430888798830399ll;
void TestCase() {
  long long d;
  scanf("%lld", &d);
  d %= 360;
  if (d < 0) d += 360;
  int ans = INF, cnt = 0;
  for (int i = 0; i < 4; ++i) {
    int nd = abs(d - 90 * i);
    if (min(nd, 360 - nd) < ans) {
      ans = min(nd, 360 - nd);
      cnt = i;
    }
  }
  printf("%d\n", cnt);
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    TestCase();
  }
  return 0;
}
