#!/usr/bin/perl -w

use v5.16;
use strict;

my $sum;
while (<>) {
	chomp;
	my @dims = sort { $a <=> $b } split /x/;
	$sum += 2*$dims[0] + 2*$dims[1] + $dims[0]*$dims[1]*$dims[2];
}

say $sum;
	
	
