#include <bits/stdc++.h>
int hy, ay, dy, hm, am, dm, h, a, d;
bool Accept(int ha, int ay, int dy, int hm, int am, int dm) {
  if (ay <= dm) return false;
  int ta = (hm + ay - dm - 1) / (ay - dm);
  int tb = am <= dy ? INT_MAX : (ha + am - dy - 1) / (am - dy);
  return ta < tb;
}
bool Can(int tot) {
  for (int i = 0; h * i <= tot; i++)
    for (int j = 0; h * i + a * j <= tot; j++) {
      int k = (tot - h * i - a * j) / d;
      if (Accept(hy + i, ay + j, dy + k, hm, am, dm)) {
        return true;
      }
    }
  return false;
}
int main() {
  scanf("%d%d%d%d%d%d%d%d%d", &hy, &ay, &dy, &hm, &am, &dm, &h, &a, &d);
  int left = 0, right = 20000;
  while (left <= right) {
    int mid = left + (right - left) / 2;
    if (Can(mid))
      right = mid - 1;
    else
      left = mid + 1;
  }
  printf("%d\n", left);
  return 0;
}
