#include <bits/stdc++.h>
using namespace std;
int main() {
  int hy, ay, dy, hm, am, dm;
  int hp, ap, dp;
  scanf("%d%d%d", &hy, &ay, &dy);
  scanf("%d%d%d", &hm, &am, &dm);
  scanf("%d%d%d", &hp, &ap, &dp);
  int res = 0;
  if (ay <= dm) {
    res += ap * (dm + 1 - ay);
    ay = dm + 1;
  }
  int mres = 1000000000;
  for (int a = ay; a - dm <= hm || a == ay; a++) {
    for (int d = dy; d <= am || d == dy; d++) {
      int r = hm / (a - dm) + (hm % (a - dm) != 0);
      int h = hy - r * max(0, (am - d));
      if (h < 1)
        h = 1 - h;
      else
        h = 0;
      int tmp = (a - ay) * ap + (d - dy) * dp + h * hp;
      mres = min(mres, tmp);
    }
  }
  res += mres;
  printf("%d\n", res);
  return 0;
}
