#include <bits/stdc++.h>
long long int t;
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n, heights = 0, lim;
  cin >> n;
  for (long long int i = 1; i <= n; i++) {
    lim = (3 * (pow(i, 2)) + i) / 2;
    if (lim > n) break;
    if ((n - (2 * i)) % 3 == 0) heights++;
  }
  cout << heights << endl;
  return 0;
}
