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