#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
const double PI = acos(-1.0);
const int dx[] = {1, -1, 0, 0, 0, 0};
const int dy[] = {0, 0, 1, -1, 0, 0};
const int dz[] = {0, 0, 0, 0, 1, -1};
const int N = 10000000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 1;; i++) {
    if (sum + (i * (i + 1)) / 2 <= n)
      sum += (i * (i + 1)) / 2;
    else {
      cout << i - 1 << endl;
      break;
    }
  }
}
