#include <bits/stdc++.h>
const int INFI = 1000 * 1000 * 1000;
const long double eps = (1e-12);
const long long INFL = (long long)INFI * (long long)(INFI);
using namespace std;
int n, a[100001], b[100001], sz, ans, x, y;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  cin >> x >> y;
  sort(a + 1, a + n + 1);
  b[++sz] = a[1];
  for (int i = 2; i <= n; ++i)
    if (a[i] != a[i - 1]) b[++sz] = a[i];
  while (x != y) {
    int mx = 1;
    for (int i = 1; i <= sz; ++i)
      if (x - (x % b[i]) >= y && x % b[i] > mx) mx = x % b[i];
    x -= mx;
    while (sz && x - (x % b[sz]) < y) sz--;
    ans++;
  }
  cout << ans;
  return 0;
}
