#include <bits/stdc++.h>
using namespace std;
int main() {
  int hp_y, atk_y, def_y, hp_m, atk_m, def_m, h, a, d;
  int atk1, atk2, hp1, hp2, sum, temp, jiafa, A, B;
  while (scanf("%d%d%d%d%d%d%d%d%d", &hp_y, &atk_y, &def_y, &hp_m, &atk_m,
               &def_m, &h, &a, &d) != EOF) {
    temp = 10e9;
    jiafa = 0;
    for (int i = atk_y; i <= 201; i++) {
      for (int j = def_y; j <= 201; j++) {
        sum = (i - atk_y) * a + (j - def_y) * d;
        atk1 = i - def_m;
        atk2 = atk_m - j;
        hp1 = hp_y;
        hp2 = hp_m;
        if (atk1 <= 0) continue;
        while (hp2 > 0 && atk2 >= 0) {
          hp1 -= atk2;
          hp2 -= atk1;
          if (hp1 <= 0) {
            sum += (1 - hp1) * h;
            hp1 = 1;
          }
        }
        if (sum < temp) {
          temp = sum;
          A = atk_y;
          B = def_y;
        }
      }
    }
    printf("%d\n", temp);
  }
  return 0;
}
