cho.sh
Notes
Loading...

Building Fences

Time limit

2s

Memory limit

128 MB

Problem

There is an infinite RPG world made of hexagonal blocks. A character has N items, each of which can turn one normal block into a fence block. Use all N items so that the fence blocks are connected, and find the maximum possible area of territory.

Blocks enclosed by the fence are counted as territory, and the fence blocks themselves are also counted. The map is infinite.

Input

The first line contains the number of items N.

  • 1 ≤ N ≤ 1,000,000

Output

Print the maximum number of blocks that can be occupied.