#include <bits/stdc++.h>
long long min(long long a, long long b) { return a < b ? a : b; }
int main() {
  long long x;
  int best, i, angles[4];
  scanf("%I64d", &x);
  x %= 360;
  x += 360;
  x %= 360;
  for (best = i = 0; i < 4; ++i) {
    angles[i] = min(llabs(x - 360), x);
    x -= 90;
    if (x < 0) x += 360;
    if (angles[i] < angles[best]) best = i;
  }
  printf("%d\n", best);
  return 0;
}
