#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int hy, ay, dy, hm, am, dm, h, a, d;
  cin >> hy >> ay >> dy;
  cin >> hm >> am >> dm;
  cin >> h >> a >> d;
  long long int mn = 1e9, ans = -1;
  for (int i = ay; i < 201; ++i) {
    for (int j = dy; j < 101; ++j) {
      ans = (i - ay) * a + (j - dy) * d;
      long long int k;
      if (i - dm > 0) {
        int t1 = hm % (i - dm) == 0 ? hm / (i - dm) : hm / (i - dm) + 1;
        k = (t1)*max(am - j, 0);
        k++;
        ans += max(0LL, (k - hy)) * h;
        mn = min(mn, ans);
      }
    }
  }
  cout << mn << endl;
}
