a, b, c, d = map(int, input().split()) p, q, r, s, t = map(int, input().split()) p = [(p, a), (q, b), (r, c), (s, d)] p.sort() ans = 0 for i in range(4): if p[i][0]*p[i][1] <= t: ans += p[i][1] t -= p[i][0]*p[i][1] else: ans += t//p[i][0] break print(ans)