#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
std::vector<std::pair<long long, long long> > y;
const long long INF = 1e9;
long long go(long long a, long long ato, long long b, long long bto) {
  if (a >= ato && b >= bto) return 0;
  if (y.empty()) return INF;
  std::pair<long long, long long> yb = y.back();
  long long d = yb.first;
  long long cnt = yb.second;
  long long ca = a;
  long long cb = b;
  long long nda = 0;
  long long ndb = 0;
  while (ca < ato) {
    nda++;
    ca *= d;
  }
  while (cb < bto) {
    ndb++;
    cb *= d;
  }
  if (nda + ndb <= cnt) return nda + ndb;
  int c1 = 0;
  int c2 = 0;
  ca = a;
  cb = b;
  for (int i = 0; i < min(nda, cnt); i++) {
    ca *= d;
    c1++;
  }
  for (int i = 0; i < cnt - c1; i++) {
    cb *= d;
  }
  c2 = cnt - c1;
  long long ans = INF;
  y.pop_back();
  ans = min(ans, cnt + go(ca, ato, cb, bto));
  while (1) {
    ca /= d;
    c1--;
    cb *= d;
    c2++;
    ans = min(ans, cnt + go(ca, ato, cb, bto));
    if (c1 == 0 || c2 == ndb) break;
  }
  y.push_back(yb);
  return ans;
}
int main() {
  long long a, b, h, w, n;
  cin >> a >> b >> h >> w >> n;
  std::vector<long long> x;
  for (int i = 0; i < n; i++) {
    int u;
    scanf("%d", &u);
    x.push_back(u);
  }
  sort((x).begin(), (x).end());
  long long last = 0;
  for (auto u : x) {
    if (u == last) {
      y.back().second++;
    } else {
      y.push_back(make_pair(u, 1));
      last = u;
    }
  }
  long long ans = min(go(h, a, w, b), go(h, b, w, a));
  if (ans == INF) ans = -1;
  cout << ans;
}
