#include <bits/stdc++.h>
using namespace std;
const long long M = 998244353;
const long long N = 1000 + 10;
const long long IM = 1e15 + 37;
const long double PI = 3.1415926535897932384;
inline void PP(long long n) { cout << n << " "; }
void PV(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
void PVV(vector<pair<long long, long long> > v) {
  for (long long i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << "\n";
}
void PA(long long v[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cout << v[i] << ' ';
  cout << "\n";
}
void IN(long long a[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cin >> a[i];
}
inline void op() {}
struct info {
  long long p, k, d;
};
signed main() {
  op();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  info y, m;
  cin >> y.p >> y.k >> y.d;
  cin >> m.p >> m.k >> m.d;
  long long a, b, c;
  cin >> a >> b >> c;
  long long ans = IM;
  for (long long i = 0; i < 500; i++) {
    for (long long j = 0; j < 500; j++) {
      long long cost = i * b + j * c;
      long long x = max(0ll, (y.k + i) - m.d);
      long long u = max(0ll, m.k - (y.d + j));
      if (x == 0) continue;
      long long t = ceil(1.0 * m.p / x);
      t = t * u + 1;
      t = max(0ll, t - y.p);
      t = t * a;
      cost += t;
      ans = min(ans, cost);
    }
  }
  cout << (ans) << "\n";
  return 0;
}
