#include <bits/stdc++.h>
using namespace std;
struct Creature {
  int hp, atk, def;
};
Creature Yan, monster, upgrades;
int mat[200][200];
int hpNeeded(int atk, int def) {
  int lossHpM = max(0, (Yan.atk + atk) - monster.def);
  int lossHpY = max(0, monster.atk - (Yan.def + def));
  if (!lossHpM) return 1000000;
  int roundsM = monster.hp / lossHpM;
  if (monster.hp % lossHpM) roundsM++;
  int roundsY, ret = 0;
  if (!lossHpY) {
    ret = 0;
  } else {
    roundsY = Yan.hp / lossHpY;
    if (roundsY > roundsM) {
      ret = 0;
    } else if (roundsY == roundsM) {
      if (!(Yan.hp % lossHpY)) {
        ret = 1;
      }
    } else {
      ret = lossHpY * (roundsM - roundsY);
      ret += -Yan.hp % lossHpY + 1;
    }
  }
  return ret;
}
int solve(int atk, int def) {
  if (atk >= 200 || def >= 200) return 1000000;
  if (mat[atk][def] != -1) return mat[atk][def];
  int hp = hpNeeded(atk, def);
  mat[atk][def] = atk * upgrades.atk + def * upgrades.def + hp * upgrades.hp;
  int temp = 1000000;
  if (hp) temp = min(solve(atk + 1, def), solve(atk, def + 1));
  mat[atk][def] = min(mat[atk][def], temp);
  return mat[atk][def];
}
int main() {
  while (cin >> Yan.hp >> Yan.atk >> Yan.def) {
    memset(mat, -1, sizeof(mat));
    cin >> monster.hp >> monster.atk >> monster.def;
    cin >> upgrades.hp >> upgrades.atk >> upgrades.def;
    cout << solve(0, 0) << endl;
  }
  return 0;
}
