#t283. 我的世界

我的世界

Building a Cuboid

Problem Background

Special for beginners, ^_^

Problem Description

Minecraft is an almost omnipotent sandbox game in which players can use various in-game resources to create and build their own world.

In Minecraft, the basic building block is a cube of side length 11. Tony wants to use NN such small cubes to build a cuboid, and decorate it with his treasured stickers. One sticker can cover exactly one face of a small cube. How many stickers will he need at minimum?

Input Format

One integer NN, the number of small cubes Tony owns. NN does not exceed 10001000.

Output Format

One integer: the minimum number of stickers Tony needs.

Sample Input

9

Sample Output

30

Constraints

Time limit: 1s, memory limit: 1024KiB for each test case.

Hint

To use the fewest stickers, the cuboid built from the NN cubes should have the smallest possible surface area — make its three dimensions as close to each other as possible.