#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x;
  int tn, ans, cha;
  while (~scanf("%I64d", &x)) {
    tn = (x % 360 + 360) % 360;
    cha = min(tn, 360 - tn);
    ans = 0;
    for (int i = 1; i <= 3; i++) {
      tn = (tn + 270) % 360;
      if (cha > min(tn, 360 - tn)) {
        cha = min(tn, 360 - tn);
        ans = i;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
