C = [int(raw_input()) for _ in xrange(26)] h,e,l,o,w,r,d = [C[i] for i in [7,4,11,14,22,17,3]] print h*e*(o/2)*w*((o+1)/2)*r*d*max(i*(i-1)/2*(l-i) for i in range(2,l+1))