#include <bits/stdc++.h>
using namespace std;
int hy, ay, dy;
int hm, am, dm;
int h, a, d;
bool firstok = true;
bool ok(int H, int A, int D) {
  int d1 = max(0, A - dm);
  int d2 = max(0, am - D);
  if (d1 == 0 && d2 == 0) return false;
  if (d2 == 0) return true;
  if (d1 == 0) return false;
  int r1 = (int)ceil(double(hm) / d1);
  if (H % d2 == 0 && r1 < H / d2)
    return true;
  else if (H % d2 != 0 && r1 <= H / d2)
    return true;
  return false;
}
int main() {
  cin >> hy >> ay >> dy;
  cin >> hm >> am >> dm;
  cin >> h >> a >> d;
  int minm = 100000000;
  for (__typeof(200) i = 0; i < (200); ++i)
    for (__typeof(200) j = 0; j < (200); ++j) {
      int A = ay + i;
      int D = dy + j;
      int k1 = max(0, A - dm);
      int k2 = max(0, am - D);
      if (k1 == 0) continue;
      if (k2 == 0) {
        minm = min(minm, i * a + j * d);
        continue;
      }
      int t = (int)ceil((double)hm / k1);
      int k = t * k2 - hy + 1;
      k = max(0, k);
      minm = min(minm, i * a + j * d + k * h);
    }
  cout << minm << endl;
  return 0;
}
