Aztec Pyramid#3889

Aztec Pyramid

1 second
128 megabytes
Very easy

Aztec emperor Cuitlahuac is going to build a pyramid in his honor. This pyramid should be taller than previous ones.

The Aztec pyramid is built out of stone blocks. Each block is 1 \times 1 \times 1 cube. Cuitlahuac places first block on the ground during the foundation ceremony. Each of the following blocks must share a face with at least one of the previous blocks.

prb3889.gif

The block is stable if it stands on the ground, or it stands on another block, that has a block or the ground next to each face. To stand the test of time the pyramid must be stable i.e. each block of it must be stable.

prb3889_1.gif

Cuitlahuac asks you to determine the height of the tallest stable pyramid that can be built out of available blocks.

Input

Contains the number (1 \le n \le 10^9) of available blocks, including the first one.

Output

Print the height of the tallest stable pyramid that may be built out of blocks.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading