#include <bits/stdc++.h>
using namespace std;
long long a;
int main() {
  cin >> a;
  a %= 360;
  if (a > 180) a -= 360;
  long long mn = 360, ans = -1;
  for (int cnt = 0; cnt < 100; cnt++) {
    if (abs(a) >= 180) {
      a %= 360;
      a = (360 + a) % 360;
    }
    if (mn > abs(a)) mn = abs(a), ans = cnt;
    a -= 90;
  }
  cout << ans << "\n";
}
