#include <bits/stdc++.h>
using namespace std;
const int nmax = 1000;
int main() {
  long long HPy, DEFy, ATKy, HPm, DEFm, ATKm, h, a, d, ty, tm, x, x1, x2, xodm,
      xody, m, xxx = 0, minimum = 9999999999;
  cin >> HPy >> ATKy >> DEFy >> HPm >> ATKm >> DEFm;
  long long tHPy, tDEFy, tATKy, tHPm, tDEFm, tATKm;
  cin >> h >> a >> d;
  x = 0;
  ty = max(x, ATKm - DEFy);
  tm = max(x, ATKy - DEFm);
  if (DEFy < ATKm) {
    xxx = ATKm - DEFy;
  }
  if (ty == 0)
    xody = 9999999;
  else {
    xody = HPy / ty;
    if (HPy % ty > 0) xody++;
    if (HPy <= ty) xody = 0;
  }
  if (tm == 0)
    xodm = 9999999;
  else {
    xodm = HPm / tm;
    if (HPm % tm > 0) xodm++;
    if (HPm <= tm) xodm = 0;
  }
  if ((xody > xodm) || ((xody > 0) && (xodm < 1))) {
    cout << "0";
    return 0;
  }
  long long temp = 0, ans = 0;
  for (int i = 0; i <= 1000; i++) {
    tHPy = HPy + i;
    for (int j = 0; j <= xxx; j++) {
      tDEFy = DEFy + j;
      for (int z = 0; z <= 200; z++) {
        tATKy = ATKy + z;
        temp = i * h + z * a + j * d;
        ty = max(x, ATKm - tDEFy);
        tm = max(x, tATKy - DEFm);
        if (ty == 0)
          xody = 9999999;
        else {
          xody = tHPy / ty;
          if (tHPy % ty > 0) xody++;
          if (tHPy <= ty) xody = 0;
        }
        if (tm == 0)
          xodm = 9999999;
        else {
          xodm = HPm / tm;
          if (HPm % tm > 0) xodm++;
          if (HPm <= tm) xodm = 0;
        }
        if ((xody > xodm) || ((xody > 0) && (xodm < 1))) {
          if (temp < minimum) {
            minimum = temp;
          }
        }
      }
    }
  }
  cout << minimum;
  cin >> a;
  return 0;
}
