L1,L2,L3=sorted(map(int,input().split())) N1,N2,N3=sorted(map(int,input().split())) n=N1*(L2+L3)+N2*(L3+L1)+N3*(L1+L2) print(2*n)