import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

struct P {
    int cost, count;
}
 
void main() {
    int[] a = new int[3];
    int d, e;
    int[] n = new int[3];
    P[] p = new P[3];
    bool input() {
        foreach (i; 0 .. 3) { scanf("%d", &a[i]); }
        scanf("%d %d\n", &d, &e);
        if (a.all!"a == 0" && d == 0 && e == 0) return false;
        foreach (i; 0 .. 3) { scanf("%d", &n[i]); }
        foreach (i; 0 .. 3) { p[i] = P(a[i], n[i]); }
        return true;
    }
    void solve() {
        p.sort!("a.cost > b.cost");
        //p.writeln;
        if (p[2].cost >= e) {
            writeln(reduce!"a + b.count"(0, p) * e);
            return;
        }
        int ans = reduce!"a + b.cost * b.count"(0, p);
        int i = 0;
        int[3] set = [0, 0, 0];
        while (true) {
            int set_cost = 0;
            foreach (x; 0 .. 3) {
                set_cost += set[x] * p[x].cost;
            }
            int set_count = set.reduce!"a + b";
            set_cost = min(set_cost, max(d, set_count) * e);
            int other_cost = 0;
            foreach (x; 0 .. 3) {
                other_cost += (p[x].count - set[x]) * p[x].cost;
            }
            int cur_cost = set_cost + other_cost;

            //if (prev < cur_cost) break;

            //writeln(set, " -> ", cur_cost);
            ans = min(ans, cur_cost);

            if (set[i] == p[i].count) i++;
            else {
                set[i]++;
            }
            if (i == 3) break;
        }
        ans.writeln;
    }
    while (input) solve;
}