#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000007LL;
const long long maxn = 100005LL;
const long long mod = 7654321LL;
long long a, b, w, h, n;
long long times[maxn];
int pos;
int ans;
int get_bin(long long base, long long target) {
  if (base >= target) return 0;
  for (int(i) = (1); (i) <= (30); i++)
    if ((long long)(1 << i) * base >= target) return i;
}
void dfs(long long prw, long long prh, int now) {
  if (now > ans) return;
  if (prw * w >= a && prh * h >= b) {
    ans = now - 1;
    return;
  }
  if (now == pos) {
    ans = min(ans, now + get_bin(prw * w, a) + get_bin(prh * h, b) - 1);
    return;
  }
  if (prw * w < a) dfs(prw * times[now], prh, now + 1);
  if (prh * h < b) dfs(prw, prh * times[now], now + 1);
}
inline bool cmp(int c1, int c2) { return c1 > c2; }
int main() {
  cin >> a >> b >> w >> h >> n;
  for (int(i) = (1); (i) <= (n); i++) cin >> times[i];
  sort(times + 1, times + n + 1, cmp);
  for (int(i) = (1); (i) <= (n); i++)
    if (times[i] == 2) {
      pos = i;
      break;
    }
  ans = n + 1;
  dfs(1, 1, 1);
  swap(a, b);
  dfs(1, 1, 1);
  cout << (ans <= n ? ans : -1) << endl;
  return 0;
}

### Prompt

Construct a CPP code solution to the problem outlined:

In one of the games Arkady is fond of the game process happens on a rectangular field. In the game process Arkady can buy extensions for his field, each extension enlarges one of the field sizes in a particular number of times. Formally, there are n extensions, the i-th of them multiplies the width or the length (by Arkady's choice) by ai. Each extension can't be used more than once, the extensions can be used in any order.

Now Arkady's field has size h × w. He wants to enlarge it so that it is possible to place a rectangle of size a × b on it (along the width or along the length, with sides parallel to the field sides). Find the minimum number of extensions needed to reach Arkady's goal.

Input

The first line contains five integers a, b, h, w and n (1 ≤ a, b, h, w, n ≤ 100 000) — the sizes of the rectangle needed to be placed, the initial sizes of the field and the number of available extensions.

The second line contains n integers a1, a2, ..., an (2 ≤ ai ≤ 100 000), where ai equals the integer a side multiplies by when the i-th extension is applied.

Output

Print the minimum number of extensions needed to reach Arkady's goal. If it is not possible to place the rectangle on the field with all extensions, print -1. If the rectangle can be placed on the initial field, print 0.

Examples

Input

3 3 2 4 4
2 5 4 10


Output

1


Input

3 3 3 3 5
2 3 5 4 2


Output

0


Input

5 5 1 2 3
2 2 3


Output

-1


Input

3 4 1 1 3
2 3 2


Output

3

Note

In the first example it is enough to use any of the extensions available. For example, we can enlarge h in 5 times using the second extension. Then h becomes equal 10 and it is now possible to place the rectangle on the field.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000007LL;
const long long maxn = 100005LL;
const long long mod = 7654321LL;
long long a, b, w, h, n;
long long times[maxn];
int pos;
int ans;
int get_bin(long long base, long long target) {
  if (base >= target) return 0;
  for (int(i) = (1); (i) <= (30); i++)
    if ((long long)(1 << i) * base >= target) return i;
}
void dfs(long long prw, long long prh, int now) {
  if (now > ans) return;
  if (prw * w >= a && prh * h >= b) {
    ans = now - 1;
    return;
  }
  if (now == pos) {
    ans = min(ans, now + get_bin(prw * w, a) + get_bin(prh * h, b) - 1);
    return;
  }
  if (prw * w < a) dfs(prw * times[now], prh, now + 1);
  if (prh * h < b) dfs(prw, prh * times[now], now + 1);
}
inline bool cmp(int c1, int c2) { return c1 > c2; }
int main() {
  cin >> a >> b >> w >> h >> n;
  for (int(i) = (1); (i) <= (n); i++) cin >> times[i];
  sort(times + 1, times + n + 1, cmp);
  for (int(i) = (1); (i) <= (n); i++)
    if (times[i] == 2) {
      pos = i;
      break;
    }
  ans = n + 1;
  dfs(1, 1, 1);
  swap(a, b);
  dfs(1, 1, 1);
  cout << (ans <= n ? ans : -1) << endl;
  return 0;
}

```