a, b, c, d = map(int, input().split()) p, q, r, s, t = map(int, input().split()) A = [(a, p), (b, q), (c, r), (d, s)] A.sort(key=lambda x: x[1]) tot = 0 for a, b in A: x = min(a, t // b) tot += x t -= x * b print(tot)