#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2) return x * power(x * x, (n - 1) / 2);
  return power(x * x, n / 2);
}
long long int powerm(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2)
    return (x * powerm((x * x) % 1000000007, (n - 1) / 2)) % 1000000007;
  return powerm((x * x) % 1000000007, n / 2);
}
long long int Hy, Ay, Dy;
long long int Hm, Am, Dm;
long long int h, a, d;
bool check(long long int hh, long long int aa, long long int dd) {
  long long int lhs = (Ay + aa - Dm);
  long long int rhs = (Am - Dy - dd);
  if (lhs <= 0) return false;
  long long int tm = (Hm / (lhs)) + ((Hm % (lhs)) != 0);
  long long int at_hy = rhs * tm;
  if (Hy + hh > at_hy) {
    return true;
  }
  return false;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> Hy >> Ay >> Dy;
  cin >> Hm >> Am >> Dm;
  cin >> h >> a >> d;
  long long int ans = INT_MAX;
  for (long long int aa = 0; aa <= 201; aa++) {
    for (long long int dd = 0; dd <= 100; dd++) {
      long long int lo = 0, hi = 100000000000;
      long long int hh;
      while (lo < hi) {
        hh = (lo + hi) / 2;
        if (check(hh, aa, dd)) {
          hi = hh;
        } else {
          lo = hh + 1;
        }
      }
      ans = min(ans, (aa * a) + (lo * h) + (dd * d));
    }
  }
  if (ans < INT_MAX) {
    cout << ans << "\n";
  } else {
    cout << 0;
  }
  return 0;
}
