#include <bits/stdc++.h>
using namespace std;
long long hpa, atka, defa, hpm, atkm, defm, php, patk, pdef;
long long get(long long def, long long atk) {
  if (atk + atka - defm <= 0) return 1e9;
  long long s = 0, e = 1e8, mid, ret = 1e8;
  while (s <= e) {
    mid = s + (e - s) / 2;
    long long times =
        hpm / (atk + atka - defm) + (hpm % (atk + atka - defm) != 0);
    if (hpa + mid - times * (atkm - (def + defa)) > 0)
      ret = mid, e = mid - 1;
    else
      s = mid + 1;
  }
  return ret;
}
int main() {
  cin >> hpa >> atka >> defa >> hpm >> atkm >> defm >> php >> patk >> pdef;
  long long ans = 1e10;
  for (long long i = 0; i <= 110; i++) {
    for (long long j = 0; j <= 210; j++) {
      long long cur = i * pdef + j * patk;
      cur += get(i, j) * php;
      ans = min(ans, cur);
    }
  }
  cout << ans;
  return 0;
}
