#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  int m = -(n % 360);
  int ans = 400;
  int cnt;
  for (int i = 0; i <= 3; i++) {
    if (i) m += 90;
    m %= 360;
    int Min;
    if (m < 0)
      Min = min(-m, 360 + m);
    else
      Min = min(m, 360 - m);
    if (ans > Min) {
      ans = Min;
      cnt = i;
    }
  }
  cout << cnt << endl;
  return 0;
}
