#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long h1, a1, d1, h2, a2, d2, h, a, d, m = 1e18;
  cin >> h1 >> a1 >> d1 >> h2 >> a2 >> d2 >> h >> a >> d;
  for (long long i = 0; i <= 10000; i++) {
    for (long long j = 0; j <= 199; j++) {
      for (long long k = 0; k <= 100; k++) {
        long long ch = h1 + i, ca = a1 + j, cd = d1 + k;
        if (ca <= d2) continue;
        long long dm = ca - d2, dy = a2 - cd;
        if (dy <= 0) {
          m = min(m, (long long)(i * h + j * a + d * k));
          break;
        } else {
          long long tm = h2 / dm, ty = ch / dy;
          if (h2 % dm != 0) tm++;
          if (ch % dy != 0) ty++;
          if (tm < ty) {
            m = min(m, (long long)(i * h + j * a + d * k));
            break;
          }
        }
      }
    }
  }
  cout << m;
}
