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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

public class Main {
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static boolean eof = false;

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public static void main(String[] args) throws IOException {
		tokenizer = null;
		// reader = new BufferedReader(new FileReader("grave.in"));
		// writer = new PrintWriter(new FileWriter("grave.out"));
		reader = new BufferedReader(new InputStreamReader(System.in, "ISO-8859-1"));
		writer = new PrintWriter(System.out);
		banana();
		reader.close();
		writer.close();
	}

	static List<ArrayList<Integer>> g = new ArrayList<ArrayList<Integer>>();
	static boolean used[];
	static int size[];

	static void dfs(int v) {
		used[v] = true;

		for (int i = 0; i < g.get(v).size(); ++i) {
			int to = g.get(v).get(i);
			if (!used[to]) {
				dfs(to);
				size[v] += size[to];
			}

		}
		size[v]++;
	}

	static int counter = 0;

	static void dfs2(int v) {
		used[v] = true;

		for (int i = 0; i < g.get(v).size(); ++i) {
			int to = g.get(v).get(i);
			if (used[to])
				continue;
			if (size[to] % 2 == 0) {
				counter++;
				size[v] -= size[to];
			}
			dfs2(to);
		}
	}

	static void banana() throws IOException {
		int n = nextInt();
		int curSum = 0;
		int curLevel = 1;
		while (n >= curSum + curLevel)
		{
			curSum += curLevel;
			curLevel++;
			n-=curSum;
		}
		
		System.out.println(curLevel-1);
	}
}