#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, b;
  cin >> x;
  x = ((x % 360) + 360) % 360;
  b = min(x, 360 - x);
  int out = 0;
  for (int i = 0; i < 10; ++i) {
    x = (x - 90 + 360) % 360;
    if (min(x, 360 - x) < b) b = min(x, 360 - x), out = i + 1;
  }
  cout << out;
}
