#include <bits/stdc++.h>
using namespace std;
template <class T, class L>
inline bool smax(T &x, L y) {
  return x < y ? (x = y, 1) : 0;
}
template <class T, class L>
inline bool smin(T &x, L y) {
  return y < x ? (x = y, 1) : 0;
}
const int maxn = 3e3 + 17, mod = 1e9 + 7;
int hp1, att1, def1, hp2, att2, def2, hpc, attc, defc;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> hp1 >> att1 >> def1 >> hp2 >> att2 >> def2 >> hpc >> attc >> defc;
  int ans = 1e9;
  for (int j = 0; j < 300; j++)
    for (int k = 0; k < 300; k++)
      if (att1 + j > def2) {
        int time = (hp2 + att1 + j - def2 - 1) / (att1 + j - def2);
        int dmg = max(0, time * (att2 - (def1 + k)));
        int i = max(0, dmg - hp1 + 1);
        ans = min(ans, i * hpc + j * attc + k * defc);
      }
  cout << ans << '\n';
}
