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>
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.lang.String;

public class Solution {

    public static void main(String[] args) {
        new Solution().myRun();
    }

    FastInputScanner in;
    PrintWriter out;

    void solveTask() {
        int n = in.nextInt();
        int answer = 0;
        for (int i = 1; i <= 10000; ++i) {
            int cur = i * (i + 1) / 2;
            if (cur <= n) {
                ++answer;
                n -= cur;
            }
        }
        out.println(answer);
    }

    void myRun() {
        in = new FastInputScanner(System.in);
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solveTask();
        out.close();
    }

    void myRunIO(){
        try  {
            in = new FastInputScanner(new File("input.txt"));
            out = new PrintWriter(new FileWriter(new File("output.txt")));
            solveTask();
            out.close();
        } catch(Exception exception){
            exception.printStackTrace();
        }
    }

    class FastInputScanner{

        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        public FastInputScanner(File file){
            try{
                bufferedReader = new BufferedReader(new FileReader(file));
            }
            catch(IOException exception){
                exception.printStackTrace();
            }
        }

        public FastInputScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 32768);
        }

        String next(){
            while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                }
                catch(IOException exception) {
                    exception.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

        int nextInt(){
            return Integer.parseInt(next());
        }

        double nextDouble(){
            return Double.parseDouble(next());
        }

        float nextFloat(){
            return Float.parseFloat(next());
        }

        String nextLine(){
            try {
                return bufferedReader.readLine();
            }
            catch(Exception exception) {
                exception.printStackTrace();
            }
            return "";
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        BigInteger nextBigInteger() {
            return new BigInteger(next());
        }

        BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }

        int[] nextIntArray(int n) {
            int a[] = new int[n];
            for(int i = 0; i < n; i++)
                a[i] = Integer.parseInt(next());
            return a;
        }

        long[] nextLongArray(int n){
            long a[] = new long[n];
            for(int i = 0; i < n; i++)
                a[i] = Long.parseLong(next());
            return a;
        }

    }

}
