#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long an;
  cin >> an;
  an %= 360;
  an += 360;
  an %= 360;
  an = -an;
  an += 360;
  an %= 360;
  long long ans = 0;
  if (an > 45 && an < 135)
    ans = 3;
  else if (an >= 135 && an < 225)
    ans = 2;
  else if (an >= 225 && an < 315)
    ans = 1;
  cout << ans << '\n';
  return 0;
}
