#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
int main() {
  long long h, a, d;
  long long hp1, at1, de1;
  long long hp2, at2, de2;
  cin >> hp1 >> at1 >> de1;
  cin >> hp2 >> at2 >> de2;
  cin >> h >> a >> d;
  long long res = LINF;
  for (int da = 0; da < (int)1.111e5; da++) {
    for (int dd = 0; dd < 111; dd++) {
      long long dhp1 = max(0ll, at2 - de1 - dd);
      long long dhp2 = max(0ll, da + at1 - de2);
      long long s = a * da + d * dd;
      if (dhp2 == 0) {
        continue;
      }
      long long k = (hp2 + dhp2 - 1) / dhp2;
      long long dhp = max(0ll, k * dhp1 - hp1 + 1);
      res = min(res, s + dhp * h);
    }
  }
  cout << res << '\n';
  return 0;
}
