#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
long long const inf = 1e18;
long long solve(int a, int t, int p, int t0, int needtime, int x) {
  if (t >= t0) return needtime / t0 >= x ? 0 : inf;
  int l = -1;
  int r = needtime / t + 1;
  while (r - l > 1) {
    int mid = (l + r) >> 1;
    long long tm = mid * 1LL * t;
    if (mid + (needtime - tm) / t0 >= x)
      r = mid;
    else
      l = mid;
  }
  return r * 1LL * t > needtime ? inf : (r + a - 1) / a * 1LL * p;
}
int main() {
  ios_base::sync_with_stdio(false);
  int f, T, to;
  cin >> f >> T >> to;
  int a1, t1, p1;
  cin >> a1 >> t1 >> p1;
  int a2, t2, p2;
  cin >> a2 >> t2 >> p2;
  long long best = inf;
  for (int i = 0; i <= T; ++i) {
    long long cnt = i / t1;
    long long cost = (cnt + a1 - 1) / a1 * 1LL * p1;
    if (cnt < f) cost += solve(a2, t2, p2, to, T - i, f - cnt);
    best = min(best, cost);
  }
  if (best >= inf) best = -1;
  cout << best << endl;
}
