#include <bits/stdc++.h>
using namespace std;
const int MXN = 1001;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int hpa, ata, dea, hpb, atb, deb, h, a, d;
  cin >> hpa >> ata >> dea >> hpb >> atb >> deb >> h >> a >> d;
  int ans = 1e8;
  for (int i = hpa; i < MXN; i++) {
    for (int j = ata; j < MXN; j++) {
      if (j - deb <= 0) continue;
      int secb = ceil((double)hpb / (j - deb));
      int mnk = atb - ceil((double)i / secb);
      mnk = max(mnk + 1, dea);
      ans = min(ans, h * (i - hpa) + a * (j - ata) + d * (mnk - dea));
    }
  }
  cout << ans;
}
