Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must consist of 1 cube, the second level must consist of 1 + 2 = 3 cubes, the third level must have 1 + 2 + 3 = 6 cubes, and so on. Thus, the i-th level of the pyramid must have 1 + 2 + ... + (i - 1) + i cubes.

Vanya wants to know what is the maximum height of the pyramid that he can make using the given cubes.

Input

The first line contains integer n (1 ≤ n ≤ 104) — the number of cubes given to Vanya.

Output

Print the maximum possible height of the pyramid in the single line.

Examples

Input

1


Output

1


Input

25


Output

4

Note

Illustration to the second sample: 

<image>
#include <bits/stdc++.h>
using namespace std;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
int a[101];
string s;
int k, n, t, opt;
int mod = 1988;
int dp[5000 + 1][5000 + 1];
int dp2[27][100 + 1];
set<string> ss;
set<string>::iterator it;
int solv2(int i, int j) {
  if (j == n) return 0;
  if (dp2[i][j] != -1) return dp2[i][j];
  if ((s[j] - 'a') >= i) {
    return dp2[i][j] = max(1 + solv2((s[j] - 'a'), j + 1), solv2(i, j + 1));
  } else
    return dp2[i][j] = solv2(i, j + 1);
}
int printt(int i, int j, string so) {
  if (j == n) {
    cout << so.size();
    if (so.size() == opt) {
      ss.insert(so);
    }
    return 0;
  }
  if (dp2[i][j] != -1) return dp2[i][j];
  if ((s[j] - 'a') >= i) {
    return dp2[i][j] = max(1 + printt((s[j] - 'a'), j + 1, (so + s[j])),
                           printt(i, j + 1, so));
  } else
    return dp2[i][j] = printt(i, j + 1, so);
}
int solv(int sum, int prev, int j) {
  if (sum == 0 && j == k) return 1;
  if (sum <= 0 || j >= k) return 0;
  if (dp[sum][j] != -1) return dp[sum][j];
  int re = 0;
  if (j == k - 1) {
    return dp[sum][j] = (sum < prev) ? 0 : 1;
  }
  for (int i = prev; i <= (sum / (k - j)) + 1; i++) {
    re += solv(sum - i, i, j + 1) % mod;
  }
  return dp[sum][j] = re % mod;
}
int main() {
  int m, res = 0, be = 1;
  scanf("%d", &m);
  int i = 1;
  while (be <= m) {
    res += 1;
    m -= be;
    i++;
    be += i;
  }
  cout << res;
  return 0;
}
