#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, T, ans, big, cas, hy, ay, dy, hm, am, dm, h, a, d, m_hp,
    y_hp, times, myhp, money;
bool flag;
int main() {
  scanf("%d%d%d", &hy, &ay, &dy);
  scanf("%d%d%d", &hm, &am, &dm);
  scanf("%d%d%d", &h, &a, &d);
  ans = 1 << 30;
  for (i = max(ay, dm + 1); i <= 220; i++) {
    for (j = dy; j <= 110; j++) {
      m_hp = max(0, i - dm);
      y_hp = max(0, am - j);
      times = ceil(hm * 1.0 / m_hp);
      myhp = times * (y_hp);
      money = max(myhp - hy + 1, 0) * h + (i - ay) * a + (j - dy) * d;
      ans = min(ans, money);
    }
  }
  printf("%d\n", ans);
  return 0;
}
