a,b,c,x,y,z=STDIN.read.split.map &:to_i s=0;[x,y,z].sort.zip([a,b,c].sort.map{|x|a+b+c-x}).map{|a,b|s+=a*b};p 2*s