#include <bits/stdc++.h>
using namespace std;
const long long sz = 1e5 + 10;
vector<int> v;
int main() {
  long long n;
  scanf("%lld", &n);
  for (long long i = 1; i <= n; ++i) {
    long long num;
    scanf("%lld", &num);
    v.push_back(num);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  long long ans = 0, a, b;
  cin >> a >> b;
  while (a > b) {
    while (!v.empty() && a - (a % v.back()) < b) v.pop_back();
    ans++;
    long long nxt = a - 1;
    for (const int x : v) {
      long long nxt2 = a - (a % x);
      if (nxt2 >= b) nxt = min(nxt, nxt2);
    }
    a = nxt;
  }
  cout << ans << '\n';
  return 0;
}
