You've got a rectangular parallelepiped with integer edge lengths. You know the areas of its three faces that have a common vertex. Your task is to find the sum of lengths of all 12 edges of this parallelepiped.
The first and the single line contains three space-separated integers — the areas of the parallelepiped's faces. The area's values are positive ( &gt; 0) and do not exceed 10<sup class="upper-index">4</sup>. It is guaranteed that there exists at least one parallelepiped that satisfies the problem statement.
# https://codeforces.com/problemset/problem/224/A

def gcd(a, b, c):
    n = min(a, b, c)
    g = 1
    for i in range (1, n):
        if a % i == 0 and b % i == 0 and c % i == 0:g = i
    return g
a, b, c = [int(x) for x in input().split()]

g = gcd(a, b, c)
# arr = [a, b, c]
z =[a/g, b/g, c/g, a/(a/g), b/(b/g), c/(c/g)]
d = set(z)
x = z.count(z[0])
y = z.count(z[1])
# print(z)
# print(x, y)
if x > y:
    print(int(8 * z[0] + 4 * z[1]))
else:
    print(int(8 * z[1] + 4 * z[0]))

# print(gcd(a, b, c))