#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n = 0;
  cin >> n;
  vector<int> x(n);
  for (auto& xx : x) cin >> xx;
  int a, b, ans = 0;
  cin >> a >> b;
  sort(((x)).begin(), ((x)).end());
  (x).resize(unique(((x)).begin(), ((x)).end()) - (x).begin());
  vector<int> nx;
  while (a - b) {
    ans++;
    int best = a - 1;
    nx.clear();
    for (auto& xx : x) {
      int cur = a / xx * xx;
      if (cur >= b) {
        best = (best > cur ? cur : best);
        nx.push_back(xx);
      }
    }
    x = nx;
    a = best;
  }
  cout << ans << endl;
  return 0;
}
