#include <bits/stdc++.h>

#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int main() {
  while(1){
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    if(!a)break;
    int na,nb,nc;
    cin>>na>>nb>>nc;
    int sum = 0;
    if (nc>=d){
      sum += e*nc;
      nc = 0;
    }
    else if(nc+nb>=d && nc*c+min(nb,d-nc)*b > e*d){
      sum += e*d;
      nb = max(0,nb-(d-nc));
      nc = 0;
    }
    else if(nc+nb<d && nc*c+nb*b+min(na,d-nc-nb)*a > e*d){
      sum += e*d;
      na = max(0,na-(d-nc-nb));
      nb = 0;
      nc = 0;
    }
    sum += nc*c+nb*b+na*a;
    cout<<sum<<endl;
  }
  return 0;
}