#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(long long a, long long b) { return (a > b); }
};
long long ceil(const long long &a, const long long &b) {
  if (a % b == 0) return a / b;
  return a / b + 1;
}
long long mod = 1000000007;
const long long N = 100005;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long Y, M, ay, dy, am, dm;
  cin >> Y >> ay >> dy;
  cin >> M >> am >> dm;
  long long H, A, D;
  cin >> H >> A >> D;
  long long ans = INT_MAX;
  long long p = 0;
  long long cst = 0;
  if (ay <= dm) {
    p = dm - ay + 1;
    long long y = max(0LL, Y - M * (am - dy));
  } else {
    p = 0;
    cst = 0;
  }
  long long c1, c2, c3;
  for (long long d = 0; d < 501; d++) {
    for (long long a = 0; a < 501; a++) {
      long long h;
      long long z1 = Y + h;
      if (max(ay + a - dm, 0LL) == 0) {
        continue;
      }
      long long x = ceil(M, ay + a - dm);
      long long y = max(0LL, am - (d + dy));
      long long z2 = x * y + 1;
      h = max(0LL, z2 - Y);
      long long mi = H * h + A * a + D * d;
      if (mi < ans) {
        ans = mi;
        c1 = h;
        c2 = a;
        c3 = d;
      }
    }
  }
  cout << ans + cst;
  return 0;
}
