#include using namespace std; using ll=long long; #include using namespace atcoder; using mint=modint998244353; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); vector> A(4); for(int i=0;i<4;i++)cin>>A[i][1]; for(int i=0;i<4;i++)cin>>A[i][0]; sort(A.begin(),A.end()); ll T; cin>>T; ll S=0; ll an=0; for(int i=0;i<4;i++){ ll D=min(A[i][1],(T-S)/A[i][0]); an+=D; S+=A[i][0]*D; } cout<