#include <bits/stdc++.h>
using namespace std;
const int N = 100500;
long long HP, ATK, DEF, HPM, ATKM, DEFM, least, mini = (long long)1e18, a, b, c,
                                                ans[20], now, need;
long long ok(int H, int A, int D) {
  long long HM, AM, DM;
  HM = HPM;
  AM = ATKM;
  DM = DEFM;
  if (A <= DEFM) return (long long)1e18;
  while (1) {
    HM -= A - DM;
    H -= max(AM - D, 0ll);
    if (HM <= 0) {
      if (H > 0) {
        return 0;
      } else {
        return abs(H) + 1;
      }
      return 1;
    }
  }
}
void solve(int v) {
  if (v == 3) {
    need = ok(HP, ATK + ans[1], DEF + ans[2]);
    if (need != (long long)1e18) {
      mini = min(mini, need * a + ans[1] * b + ans[2] * c);
    }
    return;
  }
  for (int i = 0; i <= 210; i++) {
    ans[v] = i;
    solve(v + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> HP >> ATK >> DEF >> HPM >> ATKM >> DEFM >> a >> b >> c;
  if (ok(HP, ATK, DEF) == 0) {
    cout << 0;
    return 0;
  }
  solve(1);
  cout << mini;
  return 0;
}
