#include <bits/stdc++.h>
using namespace std;
const string file = "A";
const string infile = file + ".in";
const string outfile = file + ".out";
int main() {
  ostream &fout = cout;
  istream &fin = cin;
  int N;
  fin >> N;
  long long cSum = 0;
  int idx = 1;
  while (cSum + idx * (idx + 1) / 2 <= N) {
    cSum += idx * (idx + 1) / 2;
    idx++;
  }
  fout << idx - 1 << "\n";
}
