""" """ A,B,C,D = map(int,input().split()) P,Q,R,S,T = map(int,input().split()) tc = [ (P,A) , (Q,B) , (R,C) , (S,D) ] tc.sort() ans = 0 for t,c in tc: now = min( T // t , c ) ans += now T -= now * t print (ans)