#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
template <typename T, typename U>
ostream& operator<<(ostream& o, const pair<T, U>& p) {
  return o << "(" << p.first << "," << p.second << ")";
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const map<T, U>& m) {
  o << "{";
  for (const pair<T, U>& p : m) o << p.first << ": " << p.second << ",";
  return o << "}";
}
template <typename T>
ostream& operator<<(ostream& o, const set<T>& s) {
  o << "{";
  for (const T& e : s) o << s << ",";
  return o << "}";
}
template <typename T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (const T& x : v) o << x << ",";
  return o << "]";
}
template <typename T>
ostream& operator<<(ostream& o, const vector<vector<T>>& v) {
  o << "[";
  for (const vector<T>& x : v) o << x << ",\n";
  return o << "]";
}
signed main() {
  int n;
  cin >> n;
  vi xs(n);
  for (int& xi : xs) cin >> xi;
  sort(xs.begin(), xs.end());
  auto last = unique(xs.begin(), xs.end());
  xs.erase(last, xs.end());
  int a, b;
  cin >> a >> b;
  vi biggestdiv(a - b + 1, 2);
  for (int xi : xs) {
    for (int m = (b == 0 ? 0 : b - 1 + (xi - (b - 1) % xi)); m <= a; m += xi) {
      biggestdiv[m - b] = xi;
    }
  }
  priority_queue<pii> pq;
  for (int i = b; i < a; ++i) {
    pq.push({i + biggestdiv[i - b] - 1, i});
  }
  int steps = 0;
  int curr = a;
  while (curr > b) {
    int mini = curr;
    while (!pq.empty() && pq.top().first >= curr) {
      int dest = pq.top().second;
      if (dest >= b && dest < mini) mini = dest;
      pq.pop();
    }
    assert(mini <= curr - 1 && mini >= b);
    curr = mini;
    ++steps;
  }
  cout << steps << "\n";
}
