#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, k, ans = 1000000001, cost = 0, temp, varx, vary;
  int a, b, c, x, y, z, ca, cb, cc;
  cin >> a >> b >> c >> x >> y >> z >> ca >> cb >> cc;
  if (b <= z) {
    cost = (z - b + 1) * cb;
    b = z + 1;
  }
  for (j = 0; j < 250; j++) {
    if (c + j >= y) {
      ans = min(ans, cost + (j * cc));
      continue;
    }
    for (k = 0; k < 250; k++) {
      varx = a;
      vary = x;
      while (1) {
        varx = varx - (y - c - j);
        vary = vary - (b + k - z);
        if (vary <= 0) {
          if (varx > 0)
            i = 0;
          else
            i = 1 - varx;
          temp = cost + (j * cc) + (k * cb) + (i * ca);
          ans = min(ans, temp);
          break;
        }
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
