#include <bits/stdc++.h>
const long long MXN = 100 * 1000 + 10, MXD = 1000 * 1000 + 10, inf = 3e18,
                mod = 1000 * 1000 * 1000 + 7;
using namespace std;
vector<long long> inp, tmp;
long long n, a, b, dp[MXD];
long long mx[MXD];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    tmp.push_back(x);
  }
  sort(tmp.begin(), tmp.end());
  for (long long i = 0; i < n; i++) {
    if (i && tmp[i] == tmp[i - 1]) {
      continue;
    }
    inp.push_back(tmp[i]);
  }
  n = inp.size();
  cin >> a >> b;
  long long d = a - b + 1;
  for (long long i = 0; i < n; i++) {
    long long f = (a / inp[i]);
    while (b <= inp[i] * f && inp[i] * f <= a) {
      mx[inp[i] * f - b] = max(mx[inp[i] * f - b], inp[i] - 1);
      f--;
    }
  }
  for (long long i = 0; i < d; i++) {
    mx[i] = max(mx[i], 1LL);
  }
  dp[0] = 0;
  deque<pair<long long, long long> > dq;
  dq.push_back({0, mx[0]});
  for (long long i = 1; i < d; i++) {
    while (!dq.empty() && i > dq.front().second) {
      dq.pop_front();
    }
    dp[i] = dp[dq.front().first] + 1;
    dq.push_back({i, i + mx[i]});
  }
  cout << dp[d - 1] << endl;
}
