#!/usr/bin/python from operator import mul def nCr(n, r): if r == 0 or n == r: return 1 k = r if r <= n-r else n-r return reduce(mul, xrange(n, n-k, -1)) / reduce(mul, xrange(1, k+1)) dic = {ch: ord(ch)-ord('a') for ch in 'helloworld'} c = [int(raw_input()) for _ in xrange(26)] res = 1 for ch, pos in dic.items(): n = c[pos] x = n if ch == 'l': x = max(nCr(a, 2) * (n-a) for a in xrange(2, n)) if n>2 else 0 elif ch == 'o': x = max(a * (n-a) for a in xrange(1, n)) if n>1 else 0 res *= x print res