#include <bits/stdc++.h>
using namespace std;
long long gcd(long long b, long long s) { return (s != 0) ? gcd(s, b % s) : b; }
long long Pow(long long a, long long b, long long c) {
  if (b == 0)
    return 1 % c;
  else if (b == 1)
    return a % c;
  else {
    long long A = Pow(a, b / 2, c);
    A = (A * A) % c;
    if (b & 1) A = (A * a) % c;
    return A;
  }
}
const long long INF = 1e9 + 7;
const long long INF9 = 1e9 + 9;
int main() {
  int hy, ay, dy, hm, am, dm, h, a, d;
  scanf("%d %d %d %d %d %d %d %d %d", &hy, &ay, &dy, &hm, &am, &dm, &h, &a, &d);
  long long ans = INF * INF;
  for (int aa = 0; aa <= 200; aa++) {
    for (int dd = 0; dd <= 200; dd++) {
      long long bit = aa * a + dd * d;
      if (ay + aa - dm > 0) {
        int tm = (hm + (ay + aa - dm) - 1) / (ay + aa - dm);
        int hh = 0;
        if (am > dd + dy) {
          hh = max(hy, tm * (am - dd - dy) + 1) - hy;
        }
        bit += (long long)hh * h;
        ans = min(ans, bit);
      }
    }
  }
  printf("%I64d\n", ans);
}
