a,b,c,d = map(int,input().split()) p,q,r,s,t = map(int,input().split()) count = 0 mondai = [a,b,c,d] zikann = [p,q,r,s] for i,j in zip(mondai, zikann): if (i * j) <= t: count += i t -= i * j elif (i * j) >= t: while t > 0: if t - j >= 0: count += 1 t = t - j print(count)