a,b,c,*r=gets.split.map &:to_i;p [-a-b,-b-c,-c-a].sort.zip(r.sort){|x,y|-2*x*y}.sum