import sys
def processline(l):
# a x b x c
(a,b,c) = tuple(map(int,l.split('x')))
print(l, a,b,c)
A = sorted([a,b,c])
s1 = A[0]
s2 = A[1]
return 2*(s1+s2)+a*b*c
R = 0
for l in sys.stdin.readlines():
n = processline(l[:-1])
R += n
print(R)