#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x;
  int a, mna = 1000, mnb;
  cin >> x;
  a = (-x) % 360;
  if (a < 0) a += 360;
  if (abs(a) < mna || abs(360 - a) < mna) {
    mna = min(abs(a), abs(360 - a));
    mnb = 0;
  }
  a += 90;
  if (abs(a) < mna || abs(360 - a) < mna) {
    mna = min(abs(a), abs(360 - a));
    mnb = 1;
  }
  a += 90;
  if (abs(a) < mna || abs(360 - a) < mna) {
    mna = min(abs(a), abs(360 - a));
    mnb = 2;
  }
  a += 90;
  if (abs(a) < mna || abs(360 - a) < mna) {
    mna = min(abs(a), abs(360 - a));
    mnb = 3;
  }
  cout << mnb << endl;
  return 0;
}
