#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x;
  cin >> x;
  x %= 360;
  if ((x >= -45 && x <= 45) || (x >= 315 && x <= 360) ||
      (x <= -315 && x >= -360))
    cout << 0;
  else if (x < 0) {
    int dist = 2000000000, fini;
    for (int i = 0; i < 4; i++) {
      x -= 90;
      x %= 360;
      if (x >= -180) {
        if (dist > -x) {
          dist = -x;
          fini = i;
        }
      } else {
        if (dist > x + 360) {
          dist = x + 360;
          fini = i;
        }
      }
    }
    cout << (fini + 1) % 4;
  } else {
    int dist = 2000000000, fini;
    for (int i = 0; i < 4; i++) {
      x += 270;
      x %= 360;
      if (x <= 180) {
        if (dist > x) {
          dist = x;
          fini = i;
        }
      } else {
        if (dist > 360 - x) {
          dist = 360 - x;
          fini = i;
        }
      }
    }
    cout << (fini + 1) % 4;
  }
  return 0;
}
