#include <bits/stdc++.h>
using namespace std;
int main() {
  int hy, ay, dy;
  int hm, am, dm;
  int h, a, d;
  cin >> hy >> ay >> dy;
  cin >> hm >> am >> dm;
  cin >> h >> a >> d;
  int ay_r = ay - dm;
  int am_r = am - dy;
  int ans = INT_MAX;
  int d_cost = 0;
  do {
    for (int ay_c = ay_r; ay_c <= max(ay_r, hm); ay_c++) {
      if (ay_c > 0) {
        int tm = (hm + ay_c - 1) / ay_c;
        int h_cost = max(0, (tm * am_r + 1 - hy)) * h;
        ans = min(ans, h_cost + (ay_c - ay_r) * a + d_cost);
      }
    }
    am_r--, d_cost += d;
  } while (am_r >= 0);
  cout << ans << endl;
}
