#include <bits/stdc++.h>
using namespace std;
int myATK, myHP, myDEF;
int eATK, eHP, eDEF;
int cATK, cHP, cDEF;
const int INF = 0x3f3f3f3f;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int minCost = INF;
  scanf("%d %d %d", &myHP, &myATK, &myDEF);
  scanf("%d %d %d", &eHP, &eATK, &eDEF);
  scanf("%d %d %d", &cHP, &cATK, &cDEF);
  for (int i = 0; i <= 301; i++) {
    for (int j = 0; j <= 301; j++) {
      for (int k = 0; k < 3000; k++) {
        if (myATK + i <= eDEF) continue;
        int eTurn = (eHP - 1) / (myATK + i - eDEF) + 1;
        int costHP = eTurn * (eATK - myDEF - j) - myHP;
        if (costHP >= k) continue;
        minCost = min(minCost, i * cATK + j * cDEF + k * cHP);
      }
    }
  }
  printf("%d\n", minCost == INF ? 0 : minCost);
  return 0;
}
