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