#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, A, D;
  int hp[2], atk[2], def[2];
  for (int i = 0; i < 2; i++) {
    scanf("%d%d%d", &hp[i], &atk[i], &def[i]);
  }
  scanf("%d%d%d", &H, &A, &D);
  int a, b, c;
  int minv = 1 << 30;
  int i;
  for (int j = max(atk[0], def[1] + 1); j <= 201; j++) {
    for (int k = def[0]; k <= 101; k++) {
      if (k >= atk[1]) {
        minv = min(minv, A * (j - atk[0]) + D * (k - def[0]));
      } else {
        int r2 = hp[1] / (j - def[1]);
        if (hp[1] % (j - def[1]) != 0) {
          r2++;
        }
        int i = r2 * (atk[1] - k) + 1;
        i = max(i, hp[0]);
        minv = min(minv, H * (i - hp[0]) + A * (j - atk[0]) + D * (k - def[0]));
      }
    }
  }
  printf("%d\n", minv);
  return 0;
}
