#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  n *= -1;
  n %= 360;
  if (n < 0) n += 360;
  n %= 360;
  int k = 0, m = min(n, 360 - n);
  for (int i = 1; i <= 1000; i++) {
    n += 90;
    n %= 360;
    if (min(n, 360 - n) < m) {
      m = min(n, 360 - n);
      k = i;
    }
  }
  cout << k;
  return 0;
}
