#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  long long n, res = 0;
  cin >> n;
  for (int i = 1; i <= (long long)1e7; i++) {
    long long temp = i;
    if ((n - 2 * temp >= 0) && ((n - 2 * temp) % 3 == 0) &&
        (n - 2 * temp) / 3 - temp * (temp - 1) / 2 >= 0)
      res++;
  }
  cout << res << endl;
  return EXIT_SUCCESS;
}
