#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 0;
  int h = 0;
  while (s <= n - (h * (h + 1)) / 2) {
    s += (h * (h + 1)) / 2;
    h++;
  }
  cout << h - 1 << '\n';
}
