#include <bits/stdc++.h>
using namespace std;
int hp1, atk1, def1, hp2, atk2, def2, pratk, prdef, prhp, ans = 1e9;
int cost(int turns) {
  int crcost = 0;
  int atkb =
      ceil(double((hp2 + (def2 * turns) - (atk1 * turns))) / (double)turns);
  atkb = max(0, atkb);
  crcost += atkb * pratk;
  int healthNeeded = hp1 - ((atk2 - def1) * turns);
  healthNeeded *= -1;
  healthNeeded++;
  healthNeeded = max(0, healthNeeded);
  int pack = (healthNeeded / turns);
  crcost += min(pack * prdef, pack * turns * prhp);
  int dist = (healthNeeded % turns);
  crcost += min(prdef, dist * prhp);
  return crcost;
}
int main() {
  scanf("%d%d%d", &hp1, &atk1, &def1);
  scanf("%d%d%d", &hp2, &atk2, &def2);
  scanf("%d%d%d", &prhp, &pratk, &prdef);
  for (int i = 1; i < 101; i++) {
    ans = min(ans, cost(i));
  }
  cout << ans;
  return 0;
}
