#include <bits/stdc++.h>
using namespace std;
int m1[3], m2[3], p[3];
long long solve(int i, int j, int k) {
  int val1 = m1[0] + i, val2 = m2[0];
  if (m1[1] + j - m2[2] <= 0) return -1;
  int diff = (val2 / (m1[1] + j - m2[2])) + (val2 % (m1[1] + j - m2[2]) > 0);
  val1 -= max(0, diff * (m2[1] - (m1[2] + k)));
  if (val1 > 0) {
    return i * p[0] * 1ll + j * p[1] + k * p[2];
  }
  return -1;
}
int main() {
  for (int i = 0; i < 3; ++i) {
    cin >> m1[i];
  }
  for (int i = 0; i < 3; ++i) {
    cin >> m2[i];
  }
  for (int i = 0; i < 3; ++i) {
    cin >> p[i];
  }
  long long ans = 1e18;
  for (int i = 0; i <= 1000; ++i) {
    for (int j = 0; j <= 200; ++j) {
      for (int k = 0; k <= 200; ++k) {
        long long val = solve(i, j, k);
        if (val != -1) {
          ans = min(ans, val);
        }
      }
    }
  }
  cout << ans << endl;
}
