#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, l, s = 1, a, b;
  cin >> n;
  l = 1;
  if (n < 4) {
    cout << "1";
    return 0;
  }
  for (i = 2; s < n; i++) {
    l = l + i;
    s = s + l;
    b = n - s;
    a = l + (i + 1);
    if (b < a) {
      break;
    }
  }
  cout << i;
  return 0;
}
