#include <bits/stdc++.h>
using namespace std;
long hp_y, atk_y, def_y, hp_m, atk_m, def_m, hp_a, atk_a, def_a;
long ans;
void input_data() {
  cin >> hp_y >> atk_y >> def_y;
  cin >> hp_m >> atk_m >> def_m;
  cin >> hp_a >> atk_a >> def_a;
}
bool check(long i, long j, long k) {
  long a_y = max((long)0, atk_y + j - def_m);
  long a_m = max((long)0, atk_m - (def_y + k));
  long h_y = hp_y + i;
  long h_m = hp_m;
  if (a_y == 0) return false;
  long c = (h_m + a_y - 1) / a_y;
  if ((h_y - a_m * c) > 0) {
    return true;
  } else {
    return false;
  }
}
void process_data() {
  ans = 2147483647;
  for (long i = 0; i < 1000; i++) {
    for (long j = 0; j <= 1000; j++) {
      for (long k = 0; k <= 1000; k++) {
        long buf = i * hp_a + j * atk_a + k * def_a;
        if (check(i, j, k)) {
          ans = min(ans, buf);
          break;
        }
      }
    }
  }
}
void output_data() { cout << ans; }
int main() {
  input_data();
  process_data();
  output_data();
  return 0;
}
