#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& stream, const vector<T> v) {
  stream << "[";
  for (int i = 0; i < (int)v.size(); i++) cout << v[i] << " ";
  stream << "]";
  return stream;
}
long long fpow(long long x, long long p, long long m) {
  long long r = 1;
  for (; p >>= 1;) {
    if (p & 1) r = r * x % m;
    x = x * x % m;
  }
  return r;
}
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
const long long inf = (1LL << 62);
long long f, T, t[3], a[3], p[3];
bool check(long long remF, long long remT, long long cnt2) {
  long long etime = min(cnt2 * a[2], remF) * t[2];
  remF -= etime / t[2];
  return (etime + remF * t[0] <= remT);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> f >> T >> t[0];
  long long i;
  for (i = 1; i <= 2; i++) cin >> a[i] >> t[i] >> p[i];
  long long res = inf;
  for (int k = 1; k <= 2; k++) {
    for (i = 0; a[1] * (i - 3) <= f; i++) {
      long long pr = i * p[1];
      long long tm = min(a[1] * i, f) * t[1];
      long long remT = T - tm, remF = f - tm / t[1];
      if (remT < 0) continue;
      if (t[0] <= t[2]) {
        long long ndtime = remF * t[0];
        if (ndtime <= remT) res = min(res, pr);
      } else {
        if (remF * t[2] > remT) continue;
        long long x = min((remT - remF * t[2]) / (t[0] - t[2]), remF);
        long long r = (remF - x + a[2] - 1) / a[2];
        res = min(res, pr + r * p[2]);
      }
    }
    swap(a[1], a[2]);
    swap(t[1], t[2]);
    swap(p[1], p[2]);
  }
  cout << (res == inf ? -1 : res) << "\n";
  return 0;
}
