#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<T> uni(vector<T> v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  return v;
}
int main() {
  int n;
  cin >> n;
  vector<int> x(n);
  for (auto &xi : x) cin >> xi;
  x = uni(x);
  int a, b;
  cin >> a >> b;
  int cnt = 0;
  while (a != b) {
    vector<int> nx;
    int best = a - 1;
    for (int xi : x) {
      int tmp = a / xi * xi;
      if (tmp >= b) best = min(best, tmp), nx.emplace_back(xi);
    }
    a = best, x = nx, cnt++;
  }
  cout << cnt << endl;
  return 0;
}
