#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e3 + 11;
const int inf = int(1e9);
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int hp1, hp2, atk1, atk2, def1, def2, a, b, c;
int ans = inf;
int main() {
  cin >> hp1 >> atk1 >> def1 >> hp2 >> atk2 >> def2 >> a >> b >> c;
  for (int atk = 0; atk < 5000; atk++) {
    for (int def = 0; def < 5000; def++) {
      int f1 = max(0, atk1 + atk - def2);
      int f2 = max(0, atk2 - def1 - def);
      if (f1 == 0) continue;
      int t = (hp2 + f1 - 1) / f1;
      int cur = hp1 - t * f2;
      int hp = max(0, 1 - cur);
      ans = min(ans, a * hp + b * atk + c * def);
    }
  }
  cout << ans << endl;
  return 0;
}
