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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;


 public class NextRound {
    static class Reader
    {
    BufferedReader r;
    StringTokenizer str;
    Reader()
    {
        r=new BufferedReader(new InputStreamReader(System.in));
    }
    Reader(String fileName) throws FileNotFoundException
    {
        r=new BufferedReader(new FileReader(fileName));
    }
    public String getNextToken() throws IOException
    {
        if(str==null||!str.hasMoreTokens())
    {
        str=new StringTokenizer(r.readLine());
    }
        return str.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(getNextToken());
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(getNextToken());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(getNextToken());
    }
    public String nextString() throws IOException
    {
        return getNextToken();
    }
    public int[] intArray(int n) throws IOException
    {
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i]=nextInt();
       
        return a;
       
    }
    public long[] longArray(int n) throws IOException
    {
        long a[]=new long[n];
        for(int i=0;i<n;i++)
            a[i]=nextLong();
       
        return a;
       
    }
    public String[] stringArray(int n) throws IOException
    {
        String a[]=new String[n];
        for(int i=0;i<n;i++)
            a[i]=nextString();
       
        return a;
       
    }
    public long gcd(long a, long b) {
        if(b == 0){
            return a;
        }
        return gcd(b, a%b);
    }
    }
   
    public static void main(String args[]) throws IOException{

       Reader r=new Reader();
       PrintWriter pr=new PrintWriter(System.out,false);
       
       int n=r.nextInt();
       int ans=0;
       for(int i=1;;i++)
       {
           if((i*(i+1)*(i+2)/6)<=n) ans=i;
           
           if((i*(i+1)*((2*i)+4)/12)>n) break;
       }
       pr.print(ans);
       
       pr.flush();
       pr.close();
       
    }
   
 }
