跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1827. Vanya and Cubes

    ID: 1833 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>模拟编程与模拟入门难度共享题库Codeforces英文题面题目来源题面语言

Vanya and Cubes

题目描述

A. Vanya and Cubes
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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:


题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1392 题。保留原作者与原赛事署名。