#include <bits/stdc++.h>
using namespace std;
int a[10000];
void fn() {
  a[0] = 0;
  for (int i = 1; a[i] <= 10000; i++) {
    a[i] = i + a[i - 1];
  }
}
int main() {
  fn();
  int i;
  int n, x = 1, sum = 0, c = 1;
  cin >> n;
  for (i = 1;; i++) {
    sum += a[i];
    if (sum > n) break;
  }
  if (sum == n)
    cout << i << endl;
  else
    cout << i - 1 << endl;
  return 0;
}
