#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <typename T, typename U>
static inline void amin(T& x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T& x, U y) {
  if (x < y) x = y;
}
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long min(long long a, long long b) { return (a < b) ? a : b; }
long long solve() {
  long long n;
  cin >> n;
  long long x[n];
  for (long long i = 0; i < n; ++i) cin >> x[i];
  long long a, b;
  cin >> a >> b;
  set<long long> t;
  for (long long i = 0; i < n; i++) {
    t.insert(x[i]);
  }
  long long move = 0;
  vector<long long> z(t.begin(), t.end());
  vector<long long> tz;
  while (a > b) {
    move++;
    long long ba = a - 1;
    tz.clear();
    for (auto i : z) {
      long long temp = a - (a % i);
      if (temp >= b) {
        tz.push_back(i);
        amin(ba, temp);
      }
    }
    a = ba;
    z = tz;
  }
  cout << move;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
