#include <bits/stdc++.h>
using namespace std;
long long x;
int a[4];
int main() {
  scanf("%lld", &x);
  x %= 360;
  x = (-x + 360) % 360;
  a[0] = x;
  for (int i = 1; i <= 3; ++i) a[i] = (a[i - 1] + 90) % 360;
  for (int i = 0; i < 4; ++i) a[i] = min(a[i], 360 - a[i]);
  int ans = 0;
  for (int i = 1; i <= 3; ++i)
    if (a[i] < a[ans]) ans = i;
  printf("%d\n", ans);
  return 0;
}
