#include <bits/stdc++.h>
using namespace std;
int n, k, sum;
int main() {
  cin >> n;
  k = 1;
  sum = 1;
  while ((k + 1) * (k + 2) / 2 + sum <= n) {
    sum += (k + 1) * (k + 2) / 2;
    ++k;
  }
  cout << k;
  return 0;
}
