#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int f, T, t0;
  long long int a1, t1, p1;
  long long int a2, t2, p2;
  long long int paid;
  long long int time;
  long long int res = 0x3FFFFFFFFFFFFFFFLL;
  cin >> f >> T >> t0;
  cin >> a1 >> t1 >> p1;
  cin >> a2 >> t2 >> p2;
  for (long long int j = 0; j <= f; j++) {
    if (t2 >= t0) {
      time = j * t1 + (f - j) * t0;
      if (time <= T) {
        res = min(res, ((j + a1 - 1LL) / a1) * p1);
      }
    } else {
      long long int s = f - j, e = -1LL, m;
      while (s - e > 1LL) {
        m = (s + e) / 2LL;
        if (j * t1 + m * t2 + (f - j - m) * t0 <= T) {
          s = m;
        } else {
          e = m;
        }
      }
      if (j * t1 + s * t2 + (f - j - s) * t0 <= T) {
        res = min(res, ((j + a1 - 1LL) / a1) * p1 + ((s + a2 - 1LL) / a2) * p2);
      }
    }
  }
  (res == 0x3FFFFFFFFFFFFFFFLL) ? cout << -1 : cout << res;
}
