#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e6 + 5;
const long long inf = 1e10;
const long long mod = 1e9 + 7;
long long n, a, b;
long long m[maxN];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> m[i];
  sort(m + 1, m + 1 + n);
  n = unique(m + 1, m + 1 + n) - (m + 1);
  cin >> a >> b;
  long long res = 0;
  while (a > b) {
    long long next = a - 1;
    for (long long i = 1; i <= n; i++) {
      long long tam = a - (a % m[i]);
      if (tam < b) {
        m[i--] = m[--n];
      } else {
        if (tam < next) next = tam;
      }
    }
    a = next;
    res++;
  }
  cout << res;
  return 0;
}
