#include <bits/stdc++.h>
using namespace std;
struct aaa {
  int Hp, Atk, Def;
};
aaa M, Y;
int h, a, d, rez, ans;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> Y.Hp >> Y.Atk >> Y.Def;
  cin >> M.Hp >> M.Atk >> M.Def;
  cin >> h >> a >> d;
  rez = max(0, (M.Def - Y.Atk + 1) * a);
  Y.Atk = max(Y.Atk, M.Def + 1);
  ans = rez;
  rez = 1000 * 1000 * 1000;
  for (int j = Y.Atk; j <= max(M.Hp + M.Def, Y.Atk); ++j)
    for (int i1 = Y.Def; i1 <= max(Y.Def, M.Atk); ++i1)
      for (int i = Y.Hp; i <= 10010; ++i) {
        if (i - ((M.Hp + j - M.Def - 1) / (j - M.Def)) * (M.Atk - i1) <= 0)
          continue;
        rez = min(rez, (i - Y.Hp) * h + (j - Y.Atk) * a + (i1 - Y.Def) * d);
        break;
      }
  cout << rez + ans;
  return 0;
}
