#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
const double INF = 1e15, EPS = 1e-7, PI = acos(-1);
long long angle;
int main() {
  while (cin >> angle) {
    angle = ((angle % 360) + 360) % 360;
    for (int i = 0; i < (int)(5); i++) {
      long long act = i * 90;
      if (min(abs(act - angle), 360 - abs(act - angle)) <= 45) {
        cout << i << endl;
        break;
      }
    }
  }
  return 0;
}
