#include <bits/stdc++.h>
using namespace std;
int a, d, h, ma, md, mh, na, nd, nh, ans, ca, cd, ch, de, dem, temp;
int main(int argc, const char* argv[]) {
  ios::sync_with_stdio(false);
  ans = 1000000007;
  cin >> h >> a >> d;
  cin >> mh >> ma >> md;
  cin >> ch >> ca >> cd;
  for (int na = a; na <= 220; na++) {
    for (int nd = d; nd <= 220; nd++) {
      de = max(0, ma - nd);
      dem = max(0, na - md);
      if (dem > 0) {
        int v = (mh + dem - 1) / dem;
        nh = max(h, de * v + 1);
        temp = (na - a) * ca + (nd - d) * cd + (nh - h) * ch;
        ans = min(ans, temp);
      }
    }
  }
  cout << ans << "\n";
}
