#include <bits/stdc++.h>
using namespace std;
struct comparator {
  bool operator()(long long int i, long long int j) { return i > j; }
};
bool sortpair(pair<long long int, long long int> &a,
              pair<long long int, long long int> &b) {
  return (b.first - b.second) > (a.first - a.second);
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long int min(long long int a, long long int b) { return a > b ? b : a; }
long long int min(long long int a, long long int b, long long int c) {
  if (a <= b && a <= c) {
    return a;
  } else if (b <= a && b <= c) {
    return b;
  } else {
    return c;
  }
}
long long int max(long long int a, long long int b) { return a > b ? a : b; }
long long int lcm(long long int a, long long int b) {
  return (a * b / gcd(a, b));
}
bool check(long long int x) {
  while (x % 2 == 0) {
    x /= 2;
  }
  while (x % 3 == 0) {
    x /= 3;
  }
  if (x != 1) {
    return false;
  }
  return true;
}
long long int ans(int num, int n) {
  if (n == 1) {
    return num;
  } else if (n == 2) {
    return num + 1;
  } else if (n == 3) {
    return num + 2;
  } else if (n % 3 == 0) {
    return ans(num + 2, (n - 1) / 2);
  } else if (n % 2 == 0) {
    return ans(num + 1, n / 2);
  }
}
vector<long long int> getprimes() {
  vector<long long int> pl(101, 1);
  for (int i = 2; i <= 100; i++) {
    if (pl[i] == 1) {
      for (int j = 2 * i; j <= 100; j += i) {
        pl[j] = 0;
      }
    }
  }
  return pl;
}
long long int ans(int n) {
  if (n == 0) {
    return 1;
  } else if (n == 1 || n == 2) {
    return 0;
  } else if (n < 0) {
    return 0;
  } else {
    return (ans(n - 7) | ans(n - 3));
  }
}
long long int primefactorise(int n) {
  if (n == 1) {
    return 1;
  }
  long long int ans = n;
  while (n % 2 == 0) {
    n = n / 2;
    if (n != 1) {
      ans += n;
    }
  }
  for (int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      n = n / i;
      if (n != 1) {
        ans += n;
      }
    }
  }
  ans += 1;
  return ans;
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      ans *= a;
      ans = ans % 1000000009;
    }
    b /= 2;
    a *= a;
    a = a % 1000000009;
  }
  return ans % 1000000009;
}
bool check(long long int n, long long int a, long long int b) {
  while (n > 0) {
    if (n % 10 == a || n % 10 == b) {
      n /= 10;
    } else {
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int hm, am, dm, hy, ay, dy, h, a, d;
  cin >> hy >> ay >> dy >> hm >> am >> dm >> h >> a >> d;
  int ta, td, mina = INT_MAX, mind = INT_MAX, mincost = INT_MAX;
  for (int i = ay; i <= 200; i++) {
    for (int j = dy; j <= 100; j++) {
      ta = i;
      td = j;
      if (ta > dm) {
        int time = hm / (ta - dm);
        if (hm % (ta - dm) != 0) {
          time++;
        }
        int neededhp;
        if (hy - time * (am - td) > 0) {
          neededhp = 0;
        } else {
          neededhp = time * (am - dy) - hy + 1;
        }
        if (neededhp * h + (ta - ay) * a + (td - dy) * d < mincost) {
          mincost = neededhp * h + (ta - ay) * a + (td - dy) * d;
        }
      }
    }
  }
  cout << mincost << endl;
}
