#include <bits/stdc++.h>
using namespace std;
long long ans, k, po, hpy, hpm, atky, atkm, defy, defm, z, l, h, a, d;
int prov(int x, int y) {
  if (x + atky <= defm) return 9999999999999999;
  if (defy + y >= atkm) return 0;
  l = atky + x - defm;
  z = hpm / l;
  if (hpm % l != 0) z++;
  l = atkm - (defy + y);
  l = l * z + 1;
  if (l > hpy)
    return (l - hpy);
  else
    return 0;
}
int main() {
  cin >> hpy >> atky >> defy;
  cin >> hpm >> atkm >> defm;
  cin >> h >> a >> d;
  ans = 9999999999999999;
  for (int i = 0; i < 201; i++)
    for (int j = 0; j < 201; j++) {
      k = prov(i, j);
      po = k * h + i * a + j * d;
      ans = min(ans, po);
    }
  cout << ans << endl;
}
