#coding: utf-8 ##yuki_268 l=map(int,raw_input().split()) c=map(int,raw_input().split()) l.sort() c.sort() res=(l[0]+l[1])*2*c[2] res+=(l[0]+l[2])*2*c[1] res+=(l[1]+l[2])*2*c[0] print res