#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 20, maxm = 20;
long long mod = 1e9 + 7;
int dp[maxn], x[maxm], y[maxm], c[maxn][maxm], d[maxm][maxm];
int inf = 1e9;
int n, D;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int hy, ay, dy, hm, am, dm, h, a, d;
  cin >> hy >> ay >> dy >> hm >> am >> dm >> h >> a >> d;
  int mn = inf;
  for (int i = ay; i <= 200; i++)
    for (int j = dy; j <= 100; j++)
      if (i > dm) {
        int tedad = (hm + i - dm - 1) / (i - dm);
        int x1 = (max((am - j) * tedad + 1, hy) - hy) * h;
        int x2 = (i - ay) * a;
        int x3 = (j - dy) * d;
        mn = min(mn, x1 + x2 + x3);
      }
  cout << mn;
}
