#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 7;
const int M = 1e7 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1000000007;
long long n, h, a, d, H[N], A[N], D[N], c1, c2, c3;
int main() {
  scanf("%lld%lld%lld", &h, &a, &d);
  n = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%lld%lld%lld", &H[i], &A[i], &D[i]);
  }
  scanf("%lld%lld%lld", &c1, &c2, &c3);
  long long ans = INF;
  for (long long atk = a; atk <= 200; atk++) {
    for (long long def = d; def <= 200; def++) {
      long long hp = 0;
      for (int i = 1; i <= n; i++) {
        if (atk <= D[i]) {
          hp = inf;
          break;
        }
        long long cost = max(0ll, A[i] - def);
        long long num = H[i] / (atk - D[i]);
        if (H[i] % (atk - D[i])) num++;
        hp += cost * num;
      }
      hp = max(hp + 1, h);
      long long val = (atk - a) * c2 + (def - d) * c3 + (hp - h) * c1;
      ans = min(val, ans);
    }
  }
  printf("%lld\n", ans);
  return 0;
}
