#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int N = 1e5 + 10, INF = 0x3f3f3f3f, MOD = 1e9 + 7;
long long x;
int get(int x) { return min(x, 360 - x); }
int main() {
  ios_base::sync_with_stdio(0);
  scanf("%I64d", &x);
  x = (x % 360 + 360) % 360;
  int dif = get(x), ans = 0;
  for (int i = 1; i < 4; ++i) {
    int y = ((x - 90 * i) % 360 + 360) % 360;
    y = get(y);
    if (y < dif) ans = i, dif = y;
  }
  printf("%d\n", ans);
  return 0;
}
