#!/usr/bin/perl -w

use v5.16;
use strict;

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

say $sum;
	
	
