A, B, C, D = map(int, input().split()) P, Q, R, S, T = map(int, input().split()) ans = 0 time = T for t, m in sorted([(P, A), (Q, B), (R, C), (S, D)]): x = min(m, time // t) ans += x time -= x * t print(ans)