#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  int i, j, k;
  while (scanf("%lld", &n) != EOF) {
    n = n % 360;
    if (n < 0) n += 360;
    if (n <= 45 || n >= 315) {
      printf("0\n");
      continue;
    }
    k = 0;
    while (1) {
      n -= 90;
      k++;
      if (n <= 0 && n + 90 >= 0) break;
    }
    if (abs(n) < n + 90)
      printf("%d\n", k);
    else
      printf("%d\n", k - 1);
  }
  return 0;
}
