#include <bits/stdc++.h>
using namespace std;
const long long inf = (1LL << 60);
const int maxn = 3000;
long long hy, ay, dy;
long long hm, am, dm;
long long h, a, d;
int main() {
  scanf("%lld%lld%lld%lld%lld%lld%lld%lld%lld", &hy, &ay, &dy, &hm, &am, &dm,
        &h, &a, &d);
  long long sol = inf;
  for (int j = 0; j <= maxn; j++) {
    for (int l = 0; l <= maxn; l++) {
      if (ay + j - dm <= 0) continue;
      int kol = (hm + ay + j - dm - 1) / (ay + j - dm);
      long long i = max(0LL, kol * (am - dy - l) - hy + 1);
      long long tren = i * h + j * a + l * d;
      sol = min(sol, tren);
    }
  }
  printf("%lld", sol);
  return 0;
}
