#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int hpy, atky, defy, hpm, atkm, defm, h, a, d, i, j, res = INT_MAX;
  cin >> hpy >> atky >> defy >> hpm >> atkm >> defm >> h >> a >> d;
  for (i = 0; i <= 200; i++)
    for (j = 0; j <= 100; j++)
      if (i > defm and i >= atky and j >= defy) {
        if (atkm > j)
          res = min(res,
                    (i - atky) * a + (j - defy) * d +
                        max(0, ((hpm + i - defm - 1) / (i - defm) * (atkm - j) +
                                1 - hpy) *
                                   h));
        else
          res = min(res, (i - atky) * a + (j - defy) * d);
      }
  cout << res;
  return 0;
}
