#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  int hpy, aty, defy;
  int hpm, atm, defm;
  int hpc, atc, defc;
  cin >> hpy >> aty >> defy >> hpm >> atm >> defm >> hpc >> atc >> defc;
  int minn = (1 << 30);
  for (int posAtt = aty; posAtt <= 200; ++posAtt) {
    for (int posDef = defy; posDef <= 100; ++posDef) {
      int curHpM = hpm;
      int curHpY = hpy;
      while (curHpM > 0) {
        if (max(0, posAtt - defm) == 0) break;
        curHpM -= max(0, posAtt - defm);
        curHpY -= max(0, atm - posDef);
      }
      int pos = (posAtt - aty) * atc + (posDef - defy) * defc +
                max(0, 1 - curHpY) * hpc;
      if (pos < minn && curHpM <= 0) minn = pos;
    }
  }
  cout << minn << endl;
  return 0;
}
