_,_,_,d,e,_,_,h,_,_,_,l,_,_,o,_,_,r,_,_,_,_,w=[int(input()) for _ in [0]*23]
l2=l*1//3
l1=l-l2
l1=l1*(l1-1)//2
o1=o//2
o2=o-o1
print(h*e*l1*o1*w*o2*r*l2*d)