#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const double EPS = (long double)1e-7;
unsigned int v[1010101];
int nxt(int x, int y) { return ((y - 1) / x + 1) * x; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  memset(v, -1, sizeof(v));
  int n, a, b;
  cin >> n;
  vector<int> x(n);
  for (int i = (0); i < (int)(n); ++i) cin >> x[i];
  sort((x).begin(), (x).end());
  x.resize(unique((x).begin(), (x).end()) - x.begin());
  cin >> a >> b;
  set<pair<int, int> > s;
  for (int i = (0); i < (int)(n); ++i) s.insert({nxt(x[i], b), x[i]});
  v[0] = b;
  for (int i = (b + 1); i < (int)(a + 1); ++i) {
    while (s.begin()->first + s.begin()->second <= i) {
      int x = s.begin()->second;
      s.erase(s.begin());
      s.insert({nxt(x, i - x + 1), x});
    }
    v[i - b] = min(i - 1, s.begin()->first);
  }
  int ans = 0;
  while (a != b) {
    a = v[a - b], ans++;
  }
  cout << ans << endl;
  return 0;
}
