A, B, C, D = map(int, input().split()) P, Q, R, S, T = map(int, input().split()) l = sorted([(P, A), (Q, B), (R, C), (S, D)]) rem = T ans = 0 for time, num in l: if rem > time * num: rem -= time * num ans += num else: ans += rem // time break print(ans)