#include <bits/stdc++.h>
using namespace std;
int maxx(int x, int y) {
  if (x > y) y = x;
  return y;
}
int minx(int x, int y) {
  if (x < y) y = x;
  return y;
}
int main() {
  int h1, h2, a1, a2, d1, d2, ph, pa, pd, i, j, k;
  cin >> h1 >> a1 >> d1 >> h2 >> a2 >> d2 >> ph >> pa >> pd;
  a1 -= d2;
  a2 -= d1;
  k = 99999999;
  for (i = 0; i <= 200; i++)
    for (j = 0; j <= 100; j++)
      if (a1 + i > 0)
        k = minx(k,
                 pa * i + pd * j +
                     ph * maxx(0, ((h2 - 1) / (a1 + i) + 1) * maxx(0, a2 - j) -
                                      h1 + 1));
  cout << k;
  return 0;
}
