#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int T, n, m, i, j, x, s, c = 0, flag, ans = 0;
  cin >> n;
  m = s = 0;
  for (i = 1; i <= n; i++) {
    m = m + i;
    s = s + m;
    if (s > n) {
      s = s - m;
      ans = i - 1;
      break;
    }
  }
  if (s == n) ans = i - 1;
  cout << ans << endl;
  return 0;
}
