#include <bits/stdc++.h>
using namespace std;
long long H, A, D;
long long h, a, d;
long long mH, mA, mD;
int main() {
  while (cin >> H >> A >> D >> h >> a >> d >> mH >> mA >> mD) {
    long long ans = -1;
    for (int i = max(0, (int)(d - A + 1)); i <= 20000; i++) {
      for (int j = 0; j <= max(0, int(a - D)); j++) {
        long long tans = i * mA + j * mD;
        long long times = h / (A + i - d) + ((h % (A + i - d) == 0) ? 0 : 1);
        long long myhp = times * (a - D - j) + 1;
        if (myhp > H) {
          tans += (myhp - H) * mH;
        }
        if (tans < ans || ans == -1) {
          ans = tans;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
