#include <bits/stdc++.h>
using namespace std;
int main() {
  int hy, ay, dy;
  int hm, am, dm;
  int h, y, d;
  cin >> hy >> ay >> dy >> hm >> am >> dm >> h >> y >> d;
  if (am < dy) {
    if (ay > dm) {
      cout << 0;
      return 0;
    } else
      cout << (dm - ay + 1) * y;
    return 0;
  }
  int c;
  if (ay <= dm) {
    c = (dm - ay + 1) * y;
    ay += dm - ay + 1;
  } else
    c = 0;
  int min = 999999;
  if (ay > hm + dm) {
    cout << 0;
    return 0;
  }
  for (int i = ay; i <= hm + dm; i++)
    for (int j = dy; j <= am; j++) {
      int k = hm / (i - dm);
      int l = hm % (i - dm);
      if (l != 0) k++;
      int count;
      if (hy - k * (am - j) > 0)
        count = 0;
      else
        count = -1 * h * (hy - k * (am - j) - 1);
      count += ((i - ay) * y);
      count += ((j - dy) * d);
      count += c;
      if (count < min) min = count;
    }
  cout << min;
  return 0;
}
