def main(): a=[int(input()) for _ in range(26)] a11=a[11] pl=max(n*(n-1)*(a11-n)//2 for n in range(1,a11)) a14=a[14] po=(a14//2)*(a14-a14//2) ans=a[3]*a[4]*a[7]*a[17]*a[22]*pl*po print(ans) main()