#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[3];
  int b[3];
  int h[3];
  int ans = 1000000000;
  int c[3];
  for (int i = 0; i < 3; i++) scanf("%d", a + i);
  for (int i = 0; i < 3; i++) scanf("%d", b + i);
  for (int i = 0; i < 3; i++) scanf("%d", h + i);
  ans = (a[1] - b[2] > 0 ? 0 : b[2] - a[1] + 1) * h[1] +
        (b[1] - a[2] <= 0 ? 0 : b[1] - a[2]) * h[2];
  for (int k = max(0, b[2] - a[1] + 1); k <= b[0] + b[2] - a[1]; k++) {
    for (int j = 0; j <= max(0, b[1] - a[2] + 1); j++) {
      int hk = a[1] + k - b[2], hm = b[1] - a[2] - j;
      int t = b[0] % hk == 0 ? b[0] / hk : b[0] / hk + 1;
      int m = max(0, hm * t + 1 - a[0]);
      ans = min(h[0] * m + h[1] * k + h[2] * j, ans);
    }
  }
  printf("%d\n", ans);
}
