#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int main() {
  long long n;
  cin >> n;
  int dem = 0;
  for (int i = 1; i <= trunc(sqrt(n)); i++)
    if ((n - 2 * i) % 3 == 0) {
      long long x = n - 2 * i - (long long)i * (i - 1) / 2 * 3;
      if (x >= 0) dem++;
    }
  cout << dem;
  return 0;
}
