Beer Refrigerator

Time limit1sMemory limit128 MB

Problem

Changyoung loves beer and keeps it in a refrigerator. Storing food and beer together in an ordinary refrigerator left less and less room for the beer, so he decided to build a refrigerator dedicated to beer.

The refrigerator he builds is a rectangular box of size a × b × c, and it holds exactly n cube-shaped beer boxes, each of size 1 × 1 × 1. In other words, a × b × c = n. To keep the beer fresh, the surface area of the refrigerator must be as small as possible. The surface area of the box is 2 × (a·b + b·c + c·a).

For example, when n = 12 the following refrigerators are possible.

SizeSurface area
2 × 2 × 332
1 × 3 × 438
1 × 2 × 640
1 × 1 × 1250

Among these, the refrigerator with the smallest surface area is 2 × 2 × 3, whose surface area is 32.

Write a program that, given n, computes the smallest possible surface area of a rectangular refrigerator whose volume is exactly n.

Input

The first line contains an integer n. (1 ≤ n ≤ 1,000,000)

Output

Print the smallest possible surface area of a rectangular refrigerator whose volume is n.