#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x;
  cin >> x;
  bool f = 0;
  if (x < 0) f = 1;
  x = abs(x);
  x %= 360;
  if (x < 0) x += 360;
  if (f) x = 360 - x;
  int min1 = 361;
  int ans;
  int cnt = 0;
  while (x >= 0) {
    int by = min(x, 360 - x);
    if (by < min1) {
      min1 = by;
      ans = cnt;
    }
    cnt++;
    x -= 90;
  }
  if (x < 0) {
    x = -x;
    int by = x;
    if (by < min1) {
      min1 = by;
      ans = cnt;
    }
  }
  cout << ans << endl;
  return 0;
}
