#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a1, a2, a3, b1, b2, b3, p1, p2, p3;
  cin >> a1 >> a2 >> a3 >> b1 >> b2 >> b3 >> p1 >> p2 >> p3;
  long long ans = 1e18;
  for (long long i = a2 <= b3 ? b3 + 1 : a2; i <= b3 + 110; i++) {
    for (long long j = min(a3, b2); j <= b2; j++) {
      long long t = (b1 + i - b3 - 1) / (i - b3);
      long long x = t * (b2 - j);
      x++;
      long long cost = max(0ll, x - a1);
      ans = min(ans, cost * p1 + max(0ll, j - a3) * p3 + max(0ll, i - a2) * p2);
    }
  }
  cout << ans;
}
