#include <bits/stdc++.h>
using namespace std;
const long long ool = 1e18 + 9;
const int oo = 1e9 + 9, base = 1e9 + 7;
const double eps = 1e-7;
const int N = 2e3 + 6;
long long first, T, t0;
long long cost[2], lim[2], t[2];
long long ans = ool;
void calc() {
  long long ptr = first;
  for (int i = 0; i <= first; ++i) {
    long long val1 = min(first, i * lim[0]);
    long long T1 = val1 * t[0];
    long long rem = first - val1;
    while (ptr >= 0) {
      long long val2 = min(rem, ptr * lim[1]);
      long long T2 = val2 * t[1];
      T2 += (rem - val2) * t0;
      if (T2 + T1 > T) break;
      --ptr;
    }
    ptr++;
    long long val2 = min(rem, ptr * lim[1]);
    long long T2 = val2 * t[1];
    T2 += (rem - val2) * t0;
    if (T >= T1 + T2) ans = min(ans, cost[0] * i + cost[1] * ptr);
  }
  for (int i = 0; i <= 5000; ++i) {
    for (int ptr = 0; ptr <= 5000; ++ptr) {
      long long val1 = min(first, i * lim[0]);
      long long T1 = val1 * t[0];
      long long rem = first - val1;
      long long val2 = min(rem, ptr * lim[1]);
      long long T2 = val2 * t[1];
      T2 += (rem - val2) * t0;
      if (T >= T1 + T2) ans = min(ans, cost[0] * i + cost[1] * ptr);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> first >> T >> t0;
  for (int i = 0; i <= 1; ++i) {
    cin >> lim[i] >> t[i] >> cost[i];
  }
  calc();
  swap(lim[0], lim[1]);
  swap(t[0], t[1]);
  swap(cost[0], cost[1]);
  calc();
  if (ans == ool) ans = -1;
  cout << ans << "\n";
  return 0;
}
