import sys input=lambda:sys.stdin.readline().rstrip() N=[int(input()) for i in range(26)] ans=N[7]*N[4]*N[22]*N[17]*N[3] ans*=max([i*(N[14]-i) for i in range(N[14]+1)]) ans*=max([i*(i-1)*(N[11]-i) for i in range(N[11]+1)]) print(ans//2)