#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int hpy, ay, dy, hpm, am, dm, h, a, d;
  cin >> hpy >> ay >> dy >> hpm >> am >> dm >> h >> a >> d;
  int ans = INT_MAX, sm, hp1, sum;
  for (int dy1 = dy; dy1 <= max(dy, am); ++dy1) {
    for (int ay1 = max(dm + 1, ay); ay1 <= (hpm + dm); ++ay1) {
      sm = hpm / (ay1 - dm);
      if (hpm % (ay1 - dm)) ++sm;
      if (dy1 < am)
        hp1 = max(hpy, (sm * (am - dy1)) + 1);
      else
        hp1 = hpy;
      sum = (hp1 - hpy) * h + (ay1 - ay) * a + (dy1 - dy) * d;
      ans = min(ans, sum);
    }
  }
  if (ans == INT_MAX) ans = 0;
  cout << ans << '\n';
  return 0;
}
