#include <bits/stdc++.h>
using namespace std;
int N, X[100000], U[100000], A, B, inf = 1 << 28, g[1000010];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", &X[i]);
  scanf("%d %d", &A, &B);
  int id = 0;
  set<int> st;
  for (int i = 0; i < N; i++) {
    if (st.count(X[i])) continue;
    int start = B / X[i] + (B % X[i] == 0 ? 0 : 1), end = A / X[i];
    for (int m = start; m <= end; m++)
      g[m * X[i] - B] = max(g[m * X[i] - B], X[i]);
    U[id++] = X[i];
    st.insert(X[i]);
  }
  queue<pair<int, int>> q;
  int dp = 0;
  q.push({B + g[0] - 1, 0});
  for (int v = B + 1; v <= A; v++) {
    while (q.size() > 0 && q.front().first < v) q.pop();
    dp = min(dp + 1, q.size() > 0 ? q.front().second + 1 : inf);
    q.push({v + g[v - B] - 1, dp});
  }
  printf("%d", dp);
  return 0;
}
