#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
int a, b, c, hp1, ac1, of1, hp2, ac2, of2;
bool CHECK(int hp, int ac, int of) {
  if (ac - of2 <= 0) return false;
  if (ac2 - of <= 0) return true;
  if (ceil((double)hp / (ac2 - of)) > ceil((double)hp2 / (ac - of2)))
    return true;
  return false;
}
int main() {
  while (cin >> hp1 >> ac1 >> of1 >> hp2 >> ac2 >> of2 >> a >> b >> c) {
    int ans = inf;
    if (of1 >= ac2) {
      if (ac1 > of2)
        cout << '0' << endl;
      else
        cout << (of2 + 1 - ac1) * b << endl;
      break;
    }
    for (int i = max(ac1, of2 + 1); i <= 201; ++i) {
      for (int j = of1; j <= ac2 + 1; ++j) {
        for (int k = hp1;; ++k) {
          if (CHECK(k, i, j)) {
            ans = min(ans, (k - hp1) * a + (i - ac1) * b + (j - of1) * c);
            break;
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
