#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long num, i, j, cnt = 0, sm = 0;
  cin >> num;
  long long maxi = 1;
  for (long long i = 1; i <= num; i++) {
    long long n = (i * (i + 1)) / 2;
    sm += n;
    if (sm <= num) maxi = max(maxi, i);
  }
  cout << maxi << endl;
  return 0;
}
