#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y, Z;
  int cA, cB, cC;
  scanf("%d", &(A));
  scanf("%d", &(B));
  scanf("%d", &(C));
  scanf("%d", &(X));
  scanf("%d", &(Y));
  scanf("%d", &(Z));
  scanf("%d", &(cA));
  scanf("%d", &(cB));
  scanf("%d", &(cC));
  B -= Z;
  C -= Y;
  long long best = ((int)1e9 + 10);
  for (int ATK = max(1, min(X, B)); ATK <= X; ATK++) {
    long long cost = 0;
    if (ATK - B > 0) cost += (ATK - B) * cB;
    long long bcost = ((int)1e9 + 10);
    int tKill = (X + ATK - 1) / ATK;
    for (int DMGTK = min(C, 0); DMGTK <= 0; DMGTK++) {
      long long ccost = (DMGTK - C) * cC;
      ccost = max(ccost, 0ll);
      int taken = -DMGTK * tKill;
      if (taken >= A) {
        ccost += (taken + 1 - A) * cA;
      }
      bcost = min(bcost, ccost);
    }
    best = min(best, cost + bcost);
  }
  printf("%lld\n", best);
}
