#include <bits/stdc++.h>
using namespace std;
long long hy, ay, dy, hm, am, dm, h, a, d;
long long ceil(long long n, long long k) {
  long long d = n / k;
  if (n % k) d++;
  return d;
}
void slv() {
  cin >> hy >> ay >> dy >> hm >> am >> dm >> h >> a >> d;
  long long ans = LLONG_MAX;
  for (long long i = 0; i <= 200; i++) {
    for (long long j = 0; j <= 100; j++) {
      long long dmm = max(0LL, ay + i - dm);
      if (dmm == 0LL) continue;
      long long dyy = max(0LL, am - j - dy);
      long long time_m = ceil(hm, dmm);
      long long hyy = max(0LL, time_m * dyy - hy + 1);
      ans = min(ans, h * hyy + a * i + d * j);
    }
  }
  cout << ans << endl;
}
int main() {
  int t;
  t = 1;
  for (int cs = 1; cs <= t; cs++) {
    slv();
  }
  return 0;
}
