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