#include <bits/stdc++.h>
using namespace std;
int ah, ay, ad, mh, my, md, h, a, d;
int calc(int x, int y) {
  if (x % y == 0) return x / y;
  return x / y + 1;
}
int main() {
  while (scanf("%d%d%d%d%d%d%d%d%d", &ah, &ay, &ad, &mh, &my, &md, &h, &a,
               &d) != EOF) {
    int ldy = max(md + 1 - ay, 0), udy = max(md + mh - ay, 0);
    int cost = 100000000;
    for (int dy = ldy; dy <= udy; ++dy) {
      for (int dd = max(my - ad, 0); dd >= 0; --dd) {
        int dh = max(0, calc(mh, ay + dy - md) * (my - ad - dd) - ah + 1);
        cost = min(cost, dh * h + dy * a + dd * d);
      }
    }
    printf("%d\n", cost);
  }
}
