import sys, time, random from collections import deque, Counter, defaultdict def debug(*x):print('debug:',*x, file=sys.stderr) input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 a, b, c, d = mi() p, q, r, s, t = mi() A = [(a, p), (b, q), (c, r), (d, s)] A.sort(key=lambda x: x[1]) ans = 0 for u, v in A: cnt = min(u, t // v) ans += cnt t -= cnt * v print(ans)