#include <bits/stdc++.h>
using namespace std;
int att_y, att_m, att_c, def_y, def_m, def_c, hp_y, hp_m, hp_c;
bool beat(int hp, int att, int def) {
  int hp_gain = max(att - def_m, 0);
  int hp_loss = max(att_m - def, 0);
  if (hp_gain == 0) return 0;
  if (hp_loss == 0) return 1;
  int yt = hp / hp_loss;
  int dt = hp_m / hp_gain;
  if (hp % hp_loss) yt++;
  if (hp_m % hp_gain) dt++;
  if (yt > dt) return 1;
  return 0;
}
int cost(int hp, int att, int def) {
  return (hp - hp_y) * hp_c + (att - att_y) * att_c + (def - def_y) * def_c;
}
int main() {
  scanf("%d%d%d", &hp_y, &att_y, &def_y);
  scanf("%d%d%d", &hp_m, &att_m, &def_m);
  scanf("%d%d%d", &hp_c, &att_c, &def_c);
  int min_cost = 2000000001;
  for (int i = hp_y; i < 1001; i++)
    for (int j = att_y; j < 201; j++)
      for (int k = def_y; k < 201; k++)
        if (beat(i, j, k)) min_cost = min(min_cost, cost(i, j, k));
  printf("%d\n", min_cost);
  return 0;
}
