#include <bits/stdc++.h>
using namespace std;
int main() {
  int yhp, yatk, ydef;
  int mhp, matk, mdef;
  int chp, catk, cdef;
  cin >> yhp >> yatk >> ydef;
  cin >> mhp >> matk >> mdef;
  cin >> chp >> catk >> cdef;
  int supg = 0;
  yatk -= mdef;
  if (yatk <= 0) {
    int datk = 1 - yatk;
    supg += catk * datk;
    yatk = 1;
  }
  int ans = 1000000000;
  for (int a = (0); a <= (200); ++a) {
    for (int d = (0); d <= (100); ++d) {
      int t = (mhp + yatk + a - 1) / (yatk + a);
      int thp = yhp - t * max(0, matk - ydef - d);
      int cans = a * catk + d * cdef + chp * (thp > 0 ? 0 : 1 - thp);
      if (cans < ans) ans = cans;
    }
  }
  cout << supg + ans << "\n";
  return 0;
}
