#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f;
const double pi = acos(-1.0);
const double inf = 1e18;
const long long mod = 1e9 + 7;
const unsigned long long mx = 133333331;
inline void RI(int &x) {
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0';
}
long long labs(long long x) {
  if (x < 0) return -x;
  return x;
}
long long judge(long long x) {
  x %= 360;
  if (x >= 180)
    x = x - 360;
  else if (x <= -180)
    x += 360;
  return labs(x);
}
int main() {
  long long x;
  while (cin >> x) {
    x %= 360;
    long long ans = INF;
    int f = 0;
    for (int i = 0; i <= 4; i++) {
      if (ans > judge(x - i * 90)) {
        ans = judge(x - i * 90);
        f = i;
      }
    }
    cout << f << endl;
  }
  return 0;
}
