a = map(int, input().split()) *c, t = map(int, input().split()) ans = 0 for ci, ai in sorted(zip(c, a)): x = min(ai, t // ci) ans += x t -= x * ci print(ans)