#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  cin >> x;
  x %= 360;
  if (x < 0) {
    x += 360;
  }
  long long int x1, x2, x3, x4;
  x1 = x;
  x2 = x - 90;
  x3 = x - 180;
  x4 = x - 270;
  if (x1 < 0) {
    x1 += 360;
  }
  if (x2 < 0) {
    x2 += 360;
  }
  if (x3 < 0) {
    x3 += 360;
  }
  if (x4 < 0) {
    x4 += 360;
  }
  if (x1 > 180) {
    x1 = 360 - x1;
  }
  if (x2 > 180) {
    x2 = 360 - x2;
  }
  if (x3 > 180) {
    x3 = 360 - x3;
  }
  if (x4 > 180) {
    x4 = 360 - x4;
  }
  long long int ans = min(x4, min(x3, min(x1, x2)));
  if (ans == x1) {
    cout << 0 << endl;
    return 0;
  }
  if (ans == x2) {
    cout << 1 << endl;
    return 0;
  }
  if (ans == x3) {
    cout << 2 << endl;
    return 0;
  }
  if (ans == x4) {
    cout << 3 << endl;
    return 0;
  }
  return 0;
}
