#include <bits/stdc++.h>
int yangBaseHp, yangBaseDefense, yangBaseDamage;
int monsterBaseHp, monsterBaseDefense, monsterBaseDamage;
int priceHp, priceDefense, priceDamage;
int countLifeTime(int hp, int damage, int defense) {
  int damagePerTick = std::max(damage - defense, 0);
  if (damagePerTick == 0) return -1;
  return std::ceil(static_cast<float>(hp) / static_cast<float>(damagePerTick));
}
int getMinCost(int prevMin, int damage, int defense) {
  int monsterLifeTime =
      countLifeTime(monsterBaseHp, yangBaseDamage + damage, monsterBaseDefense);
  int requiredHp =
      monsterLifeTime *
          std::max(monsterBaseDamage - yangBaseDefense - defense, 0) +
      1;
  int hp = std::max(requiredHp - yangBaseHp, 0);
  int cost = priceHp * hp + priceDamage * damage + priceDefense * defense;
  if (prevMin > cost) {
    ("Minimal cost changed from %i to %i (additional atributes are: %ihp + "
     "%idm + %idf)",
     prevMin, cost, hp, damage, defense);
    return cost;
  }
  return prevMin;
}
int main() {
  ("Hello World!");
  ("Input: Yang; Monster; Prices");
  scanf("%i %i %i", &yangBaseHp, &yangBaseDamage, &yangBaseDefense);
  scanf("%i %i %i", &monsterBaseHp, &monsterBaseDamage, &monsterBaseDefense);
  scanf("%i %i %i", &priceHp, &priceDamage, &priceDefense);
  int minCost = 2E9;
  for (int damage = std::max(monsterBaseDefense - yangBaseDamage + 1, 0);
       yangBaseDamage + damage <= monsterBaseHp + monsterBaseDefense;
       ++damage) {
    minCost = getMinCost(minCost, damage, 0);
    for (int defense = 0; yangBaseDefense + defense <= monsterBaseDamage;
         ++defense)
      minCost = getMinCost(minCost, damage, defense);
  }
  if (minCost == 2E9) minCost = 0;
  printf("%i\n", minCost);
  ("Farewell World!");
  return 0;
}
