#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t, res;
  int i, r;
  scanf("%I64d", &n);
  n %= 360;
  r = 0;
  res = 10000;
  for (i = 0; i <= 4; i++) {
    if (n > 0)
      t = min(n, 360 - n);
    else
      t = min(-n, n + 360);
    if (t < res) {
      r = i;
      res = t;
    }
    n -= 90;
    n %= 360;
  }
  printf("%d\n", r);
  return 0;
}
