#include <bits/stdc++.h>
using namespace std;
const unsigned long long INF = 2e15L;
unsigned long long hb, ab, db;
unsigned long long hm, am, dm;
unsigned long long ch, ca, cd;
inline unsigned long long win(const unsigned long long& h,
                              const unsigned long long& a,
                              const unsigned long long& d) {
  if (d >= am) return 1;
  return (hm + a - dm - 1) / (a - dm) < (h + am - d - 1) / (am - d);
}
unsigned long long ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> hb >> ab >> db;
  cin >> hm >> am >> dm;
  cin >> ch >> ca >> cd;
  ans = INF;
  for (unsigned long long(a) = (max(ab, dm + 1)); (a) < (220); (a)++)
    for (unsigned long long(d) = (db); (d) < (110); (d)++) {
      unsigned long long lo;
      if (am >= d)
        lo = am - d;
      else
        lo = 0;
      lo = max(lo, hb - 1);
      unsigned long long hi = 1100000;
      unsigned long long mid;
      while (lo + 1 < hi) {
        mid = (hi + lo) / 2;
        if (win(mid, a, d)) {
          hi = mid;
        } else {
          lo = mid;
        }
      }
      ans = min(ans, ca * (a - ab) + cd * (d - db) + ch * (hi - hb));
    }
  cout << ans << endl;
  return 0;
}
