#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MAXM = 1000000007;
const int MAX = 1e7;
const int des = 10000;
const int maxn = 1005;
int HPy, ATKy, DEFy;
int HPm, ATKm, DEFm;
int aa, bb, cc;
int mini = INF;
int main() {
  cin >> HPy >> ATKy >> DEFy;
  cin >> HPm >> ATKm >> DEFm;
  cin >> aa >> bb >> cc;
  for (int a = HPy; a <= HPy + 1000; a++)
    for (int b = ATKy; b <= ATKy + 500; b++)
      for (int c = DEFy; c <= DEFy + 500; c++) {
        if (max(0, ATKm - c) == 0 && max(0, b - DEFm) != 0 &&
            ((a - HPy) * aa + (b - ATKy) * bb + (c - DEFy) * cc) < mini) {
          mini = (a - HPy) * aa + (b - ATKy) * bb + (c - DEFy) * cc;
          continue;
        }
        if (max(0, ATKm - c) == 0) {
          continue;
        }
        int umer = a / (ATKm - c);
        if (a % (ATKm - c) != 0) umer++;
        if (ATKm - c >= a) continue;
        int zhiv = (umer - 1) * max(b - DEFm, 0);
        if (zhiv >= HPm &&
            ((a - HPy) * aa + (b - ATKy) * bb + (c - DEFy) * cc) < mini) {
          mini = (a - HPy) * aa + (b - ATKy) * bb + (c - DEFy) * cc;
          continue;
        }
      }
  cout << mini << endl;
}
