#include <bits/stdc++.h>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 0, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
long long n;
int main() {
  while (~scanf("%lld", &n)) {
    n = (n % 360 + 360) % 360;
    if (n >= 315 || n <= 45) {
      puts("0");
      continue;
    }
    int ans = 0;
    while (n > 45) {
      ++ans;
      n -= 90;
    }
    printf("%d\n", ans);
  }
  return 0;
}
