#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
long long n;
int main() {
  int i, j, k;
  cin >> n;
  n %= 360;
  n *= -1;
  n += 360;
  n %= 360;
  vector<pair<int, int> > v;
  v.emplace_back(n, 0);
  v.emplace_back(n + 90, 1);
  v.emplace_back(n + 180, 2);
  v.emplace_back(n + 270, 3);
  for (auto &e : v) e.first %= 360;
  for (auto &e : v)
    if (e.first > 180) e.first = 360 - e.first;
  sort((v).begin(), (v).end());
  cout << v[0].second;
  return 0;
}
