#include <bits/stdc++.h>
using namespace std;
typedef pair<long long, long long> ll;
typedef vector<long long> vl;
typedef vector<ll> vll;
typedef vector<vl> vvl;
template <typename T>
ostream &operator<<(ostream &o, vector<T> v) {
  if (v.size() > 0) o << v[0];
  for (unsigned i = 1; i < v.size(); i++) o << " " << v[i];
  return o << "\n";
}
template <typename U, typename V>
ostream &operator<<(ostream &o, pair<U, V> p) {
  return o << "(" << p.first << ", " << p.second << ") ";
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (unsigned i = 0; i < v.size(); i++) in >> v[i];
  return in;
}
template <typename T>
istream &operator>>(istream &in, pair<T, T> &p) {
  in >> p.first;
  in >> p.second;
  return in;
}
int main() {
  set<long long> numbers, current;
  long long n, a, b;
  cin >> n;
  for (long long i = (0); i < (long long)n; i++) {
    long long x;
    cin >> x;
    numbers.insert(x);
  }
  cin >> a >> b;
  long long ans = 0;
  while (a != b) {
    long long best = 1;
    for (auto it : numbers) {
      if (a - a % it >= b) {
        current.insert(it);
        best = max(best, a % it);
      }
    }
    numbers = current;
    current.clear();
    ans++;
    a -= best;
  }
  cout << ans;
  return 0;
}
