#include <bits/stdc++.h>
using namespace std;
int n, sum, c, m, s;
int main() {
  cin >> n;
  m = n;
  for (int i = 1; i <= n; ++i) {
    sum += i;
    n -= sum;
    c = i;
    s += sum;
  }
  if (m >= s)
    cout << c;
  else
    cout << c - 1;
  return 0;
}
