#include <bits/stdc++.h>
using namespace std;
long long int min(long long int a, long long int b) {
  if (a > b) return b;
  return a;
}
int a, h, d, a1, h1, d1, a2, h2, d2;
long long int n, m;
long long int x[201][201] = {9876543210};
bool v[201][201] = {false};
int main() {
  scanf("%d%d%d", &h1, &a1, &d1);
  scanf("%d%d%d", &h2, &a2, &d2);
  scanf("%d%d%d", &h, &a, &d);
  long long int ans = 0, ans1;
  if (a1 <= d2) {
    ans = a * (d2 - a1);
    a1 = d2;
  }
  for (int i = 0; a1 + i <= 200; ++i) {
    for (int j = 0; d1 + j <= 100; ++j) {
      int x1, y1, decM, decY;
      x1 = a1 + i;
      y1 = d1 + j;
      decM = max(0, x1 - d2);
      decY = max(0, a2 - y1);
      if (decM == 0 && decY != 0) {
        v[i][j] = false;
      }
      if (decY == 0 && decM != 0) {
        v[i][j] = true;
        x[i][j] = a * i + d * j;
      }
      if (decM == 0 && decY == 0) {
        v[i][j] = false;
      }
      if (decY != 0 && decM != 0) {
        v[i][j] = true;
        int q1, q2;
        if (h2 % decM == 0)
          q2 = h2 / decM;
        else {
          q2 = h2 / decM + 1;
        }
        x[i][j] = 0;
        x[i][j] = h * max(0, (q2 * decY + 1 + -h1));
        x[i][j] = x[i][j] + (a * i + d * j);
      }
    }
  }
  ans1 = 9876543210;
  for (int i = 0; a1 + i <= 200; ++i) {
    for (int j = 0; d1 + j <= 100; ++j) {
      if (v[i][j] == true) {
        ans1 = min(ans1, x[i][j]);
      }
    }
  }
  printf("%lld\n", (ans + ans1));
  return 0;
}
