#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long ans = 1e18;
  int myh, mya, myd;
  int mh, ma, md;
  int h, a, d;
  cin >> myh >> mya >> myd;
  cin >> mh >> ma >> md;
  cin >> h >> a >> d;
  for (int i = 0; i <= 200; i++)
    for (int j = 0; j <= 200; j++) {
      long long res = i * a + j * d;
      int at = mya + i - md;
      int at2 = ma - myd - j;
      if (at <= 0) continue;
      int co = (mh + at - 1) / at;
      int need = co * at2 + 1;
      int x = need - myh;
      if (x > 0) res += x * h;
      ans = min(ans, res);
    }
  cout << ans << "\n";
  return 0;
}
