#include <bits/stdc++.h>
using namespace std;
int sol = 1000000000;
int h;
void prueba(int hy, int hm, int dechy, int dechm, int gasto) {
  for (;;) {
    hy -= dechy;
    hm -= dechm;
    if (hy <= 0) {
      gasto += h * (-hy + 1);
      hy = 1;
    }
    if (hm <= 0) {
      sol = min(sol, gasto);
      return;
    }
  }
}
int hy, ay, dy, hm, am, dm, a, d;
int main() {
  cin >> hy >> ay >> dy >> hm >> am >> dm >> h >> a >> d;
  for (int adday = 0; adday <= 300; adday++)
    if (ay + adday - dm >= 1)
      for (int adddy = 0; adddy <= 300; adddy++)
        prueba(hy, hm, max(0, am - dy - adddy), ay + adday - dm,
               adday * a + adddy * d);
  cout << sol << endl;
}
