#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  int i, sum = 0, x = 1;
  for (i = 1; i < n; i++) {
    sum += (i * (i + 1) / 2);
    if (sum == n) {
      x = i;
      break;
    } else if (sum > n) {
      x = i - 1;
      break;
    }
  }
  cout << x << endl;
  return 0;
}
