#include <bits/stdc++.h>
using namespace std;
using ii = tuple<long long, long long>;
const long long N = 1e6 + 7, inf = 1e9 + 42;
long long binpow(long long a, long long b) {
  if (b == 0) return 1;
  long long res = binpow(a, b / 2);
  if (b % 2)
    return (res * res * a) % 1000000007;
  else
    return (res * res) % 1000000007;
}
bool compare(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return (a.second > b.second);
  else
    return (a.first <= b.first);
}
signed main() {
  long long n;
  cin >> n;
  ;
  long long k, s;
  vector<long long> x(n);
  for (long long i = 0; i < n; i++) cin >> x[i];
  sort(x.begin(), x.end());
  x.resize(unique(x.begin(), x.end()) - x.begin());
  n = x.size();
  long long a;
  cin >> a;
  ;
  long long b;
  cin >> b;
  ;
  long long cnt = 0;
  while (a > b) {
    cnt++;
    k = a - 1;
    for (long long i = 0; i < n; i++)
      if ((s = a - a % x[i]) < b)
        x[i--] = x[--n];
      else
        k = min(k, s);
    a = k;
  }
  cout << cnt << endl;
}
