#define R(x)if(r>x)r=x;
main(r,D,t,a,b,c,d,e,A,B,C){for(;scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&A,&B,&C)>7;printf("%d\n",r)){
	r=
		C>=d?a*A+b*B+e*C:
		(D=d,d-=C,t=B<d?B:d,B-=t,d-=t,t=A<d?A:d,A-=t,d-=t,(r=a*A+b*B+c*C)>(t=a*A+b*B+e*D))?t:r;
}exit(0);}