eolymp
Problems

Matches

Matches

Time limit 1 second
Memory limit 128 MiB

What is the minimum number of matches necessary to pit on the plane n squares with a side in one match? Matches can not be broken and put on each other. The vertices of the squares should be the points where the ends of the matches meet, and the sides are matches themselves.

Write a program that by the number of squares n to be constructed, finds the minimum number of matches required for this.

Input data

One integer n (1n10^9).

Output data

Print the minimum number of matches required to construct n squares.

Examples

Input example #1
4
Output example #1
12
Author Andrey Stasyuk
Source 2005 XVIII All-Ukrainian Informatics Olympiad, Rovno, April 10 - 16, Round 1