// AOJ 1509 Rental DVD Shop NEO
// 2018.1.30 bal4u

#include <stdio.h>

#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int main()
{
	int a, b, c, d, e, na, nb, nc, k, ans;
	
	while (a = in()) {
		b = in(), c = in(), d = in(), e = in();
		na = in(), nb = in(), nc = in();
		
		if (nc >= d) ans = e*nc + b*nb + a*na;
		else {
            ans = c*nc + b*nb + a*na;
			k = d-nc;
			if (k <= nb) nb -= k, k = 0;
			else         k -= nb, nb = 0;
			if (k <= na) na -= k;
			else         k -= na, na = 0;

			k = e*d + b*nb + a*na;
			if (ans > k) ans = k;
		}
		printf("%d\n", ans);
	}
	return 0;
}

