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.util.*;
public class Test {

	private static Scanner s;
	public static int []arr;
	public static int []a = new int[3];
	public static void main(String[] args) {
		s = new Scanner(System.in);
		int n = s.nextInt();
		int numOfCubes = 0;
		int level = 0;
		while(n>=numOfCubes) {
			level++;
			numOfCubes += (level*(level+1))/2;
		}
		System.out.println(level-1);
	}
	public static class knights{
		public int str;
		public long coins;
		public long maxCoins;
		public knights(int strength) {
			this.str = strength;
			this.coins = 0;
			this.maxCoins = 0;
		}
		public void setCoins(long money) {
			this.coins = money;
		}
	}
	public static int maxribbons(int len) {
		if(len==0)
			return 0;
		if(arr[len]!=0)
			return arr[len];
		if(len<a[0])
			return Integer.MIN_VALUE;
		return (arr[len] = Math.max(len-a[0]>=0?maxribbons(len-a[0])+1:0, Math.max(len-a[1]>=0?maxribbons(len-a[1])+1:0, len-a[2]>=0?maxribbons(len-a[2])+1:0)));
	}
	public static class knightsComparator implements Comparator<knights>{

		@Override
		public int compare(knights arg0, knights arg1) {
			if(arg0.str<arg1.str)
				return -1;
			else if(arg0.str>arg1.str)
				return 1;
			else {
				if(arg0.coins<arg1.coins)
					return -1;
				else if(arg0.coins>arg1.coins)
					return 1;
				else
					return 0;
			}
		}
	}
	public static class duel{
		public int x;
		public int freq;
		public duel(int x,int y) {
			this.x = x;
			this.freq = y;
		}
	}
	public static int bracketSequenceConcat(String a,String b) {
		int ans= 0;
		boolean aflag = true,bflag =true;
		Stack<Character> st = new Stack<Character>();
		for(int i=0;i<a.length();i++) {
			if(a.charAt(i)=='(')
				st.push('(');
			else if(st.isEmpty()) {
				aflag = false;
			}else {
				st.pop();
			}
		}
		if(!st.isEmpty())
			aflag = false;
		System.out.println(aflag);
		if(!aflag)
			b = a+b;
		System.out.println("b :"+b);
		for(int i=0;i<b.length();i++) {
			if(b.charAt(i)=='(')
				st.push('(');
			else if(st.isEmpty()) {
				bflag = false;
				break;
			}else {
				st.pop();
			}
			System.out.println(st.size());
		}
		if(!st.isEmpty())
			bflag = false;
		System.out.println(bflag);
		if(aflag && bflag)
			return 1;
		else if(!aflag && bflag)
			return 1;
		return ans;
	}
	public static int cuttingRod(int []a,int n) {
		if(n<=0)
			return 0;
		int ans = Integer.MIN_VALUE;
		for(int i=0;i<n;i++) {
			ans = Math.max(cuttingRod(a,n-i-1)+a[i], ans);
		}
		return ans;
	}
	/*public static int memoCuttingRod(int []a,int n) {
		if(n<=0)
			return 0;
		if(memo[n-1]!=-1)
			return memo[n-1];
		for(int i=0;i<n;i++) {
			memo[n-1] = Math.max(memo[n-1], memoCuttingRod(a,n-i-1)+a[i]);
		}
		return memo[n-1];
	}*/
	public static boolean isPrimeSqrt(int n) {
		if(n<=1)
			return false;
		else if(n==2||n==3)
			return true;
		for(int i=2;i<=Math.sqrt(n);i++) {
			if(n%i==0)
				return false;
		}
		return true;
	}
	public static int lcm(int a,int b) {
		return (a*b)/gcd(a,b);
	}
	public static int gcd(int a,int b) {
		if(a==0)
			return b;
		if(b==0)
			return a;
		if(a%b==0)
			return b;
		else
			return gcd(b,a%b);
	}
	public static boolean isPowerOfTwo(long a) {
		long diff = a;
		long test = 1;
		while(test>0) {
			if(diff==(diff&test)) {
				return true;
			}
			test = test<<1;
		}
		return false;
	}
	public static boolean boolBinarySearch(long []a,int l,int r,long target) {
		if(l<r) {
			int mid = l+(r-l)/2;
			if(target==a[mid])
				return true;
			else if(target>a[mid])
				return boolBinarySearch(a,mid+1,r,target);
			else
				return boolBinarySearch(a,l,mid-1,target);
		}
		return false; 
	}
}