#include <bits/stdc++.h>
int sum, n, tmp;
int main() {
  scanf("%d", &n);
  sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += i;
    tmp += sum;
    if (tmp > n) {
      printf("%d\n", i - 1);
      return 0;
    }
  }
  printf("%d\n", n);
}
