#include <bits/stdc++.h>
using namespace std;
int h[3];
int a[3];
int d[3];
int cost(int i, int j) {
  if (i <= d[1]) return 1000000000;
  if (j >= a[1]) return (i - a[0]) * a[2] + (j - d[0]) * d[2];
  int l = (int)ceil(h[1] / (double)(i - d[1]));
  l = l * (a[1] - j);
  l++;
  if (l <= h[0]) return (i - a[0]) * a[2] + (j - d[0]) * d[2];
  return (i - a[0]) * a[2] + (j - d[0]) * d[2] + (l - h[0]) * h[2];
}
int main() {
  ios::sync_with_stdio(false);
  int i, j, k;
  for (i = 0; i < 3; i++) cin >> h[i] >> a[i] >> d[i];
  int an = 1000000000;
  for (i = a[0]; i <= (a[0] > d[1] + 100 ? a[0] : d[1] + 100); i++)
    for (j = d[0]; j <= (d[0] > a[1] ? d[0] : a[1]); j++) {
      an = (an < cost(i, j) ? an : cost(i, j));
    }
  cout << an;
  return 0;
}
