eolymp
bolt
Try our new interface for solving problems
Problems

Bob and balls

Bob and balls

Recently Bob learned that balls can be played in a very entertaining game. In this game you want to stack the balls in the form of various geometric shapes. Just now Bob is engaged in laying the balls in the form of an equilateral triangle. But here's the thing: sometimes Bob do not have enough balls, and he wants to know, what is the greatest side of the triangle for which it is enough balls? Help Bob to count the value of $n$ --- the length of equilateral triangle for given number of balls $k$. Below given the example of placing the balls in the form of an equilateral triangle: \includegraphics{https://static.e-olymp.com/content/c0/c0522613f2195bf12b87fd6c2c32eb8dbb171e72.gif} \InputFile One positive integer $k~(0 \le k \le 2 \cdot 10^8)$ --- the existing number of balls. \OutputFile Print the value of $n$ --- the answer to the problem.
Time limit 1 second
Memory limit 128 MiB
Input example #1
6
Output example #1
3
Input example #2
5
Output example #2
2
Author Евгений Симоненко
Source Дистанционная Летняя Компьютерная Школа - лето 2013 года