r=lambda:sorted(map(int,raw_input().split())) P=r();Q=r() print(sum(P)*sum(Q)-sum(p*q for p,q in zip(P,Q)))*2