A, B, C, D = map(int, input().split()) P, Q, R, S, T = map(int, input().split()) E = sorted([(A, P), (B, Q), (C, R), (D, S)], key=lambda x:x[1]) ans = 0 for c, t in E: if t*c < T: T -= t*c ans += c else: ans += T//t break print(ans)