#include int main() { int l, w, h, a, b, c, total = 0; while (scanf("%dx%dx%d", &a, &b, &c) == 3) { l = a, w = b, h = c; if (l < w) w = l, l = b; if (w < h) { h = w, w = c; if (l < w) w = l, l = c; } total += 2*(w+h) + l*w*h; } printf("%d\n", total); return 0; }