#include <bits/stdc++.h>
using namespace std;
struct trip {
  int a, d, h;
};
trip y, m, cost;
bool cankill(trip tmp) {
  if (m.d >= tmp.a) return false;
  if (tmp.d >= m.a) return true;
  int time2killm = m.h / (tmp.a - m.d) + (m.h % (tmp.a - m.d) > 0);
  int time2killy = tmp.h / (m.a - tmp.d) + (tmp.h % (m.a - tmp.d) > 0);
  return time2killm < time2killy;
}
bool check(int tot) {
  trip tmp;
  bool found = false;
  for (int i = 0; i * cost.h <= tot && !found; ++i) {
    for (int j = 0; j * cost.d + i * cost.h <= tot && !found; ++j) {
      for (int k = 0; j * cost.d + i * cost.h + k * cost.a <= tot && !found;
           ++k) {
        tmp.a = y.a + k;
        tmp.d = y.d + j;
        tmp.h = y.h + i;
        if (cankill(tmp)) found = true;
      }
    }
  }
  return found;
}
int main() {
  cin >> y.h >> y.a >> y.d >> m.h >> m.a >> m.d >> cost.h >> cost.a >> cost.d;
  int l = 0, r = 100 * (cost.h + cost.a + cost.d);
  int mid;
  while (r - l > 1) {
    mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (check(l))
    cout << l;
  else
    cout << r;
  return 0;
}
