#include <bits/stdc++.h>
using namespace std;
int hm, am, dm, hn, an, dn, h, a, d, mn = 1e8;
int main() {
  cin >> hm >> am >> dm >> hn >> an >> dn;
  cin >> h >> a >> d;
  for (int y = 0; y <= 200; y++) {
    for (int z = 0; z <= 200; z++) {
      int dem = max(0, an - (dm + z));
      int den = max(0, am + y - dn);
      if (den == 0) continue;
      int t = (hn + den - 1) / den;
      int rem = 1 - (hm - (t * dem));
      if (rem < 0) rem = 0;
      mn = min(mn, rem * h + y * a + z * d);
    }
  }
  cout << mn << endl;
  return 0;
}
