#include <bits/stdc++.h>
using namespace std;
long long int first, t, t0, t1, t2, a1, a2, p1, p2;
long long int find1(long long int x) {
  long long int lo = 0, hi = first;
  long long int ans = first + 1;
  while (lo <= hi) {
    long long int mid = (lo + hi) / 2;
    if ((t0 * first + x * (t1 - t0) + mid * (t2 - t0)) <= t) {
      ans = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  return ans;
}
int main() {
  cin >> first >> t >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  long long int ans = 1000000000000000LL;
  for (long long int i = 0; i <= first; i++) {
    if ((t0 * first + i * (t1 - t0) <= t)) {
      ans = min(ans, (long long int)ceil((double)i / a1) * p1);
    }
  }
  for (long long int i = 0; i <= first; i++) {
    if ((t0 * first + i * (t2 - t0) <= t)) {
      ans = min(ans, (long long int)ceil((double)i / a2) * p2);
    }
  }
  for (long long int i = 0; i <= first; i++) {
    long long int j = find1(i);
    if (i + j > first) continue;
    ans = min(ans, (long long int)(ceil((double)i / a1) * p1 +
                                   ceil((double)j / a2) * p2));
  }
  if (ans == 1000000000000000LL) {
    printf("-1");
    return 0;
  }
  cout << ans << endl;
  return 0;
}
