#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int n;
const int MAXN = 100000 + 9;
int x[MAXN];
int a, b;
int rec(int a) {
  if (a == b) return 0;
  vector<int> nx;
  int na = a - 1;
  for (int i = n - 1; i >= 0; i--) {
    int nw = a - a % x[i];
    if (nw < b) continue;
    na = min(na, nw);
    nx.push_back(x[i]);
  }
  n = 0;
  for (int i = 0; i < nx.size(); i++) x[n++] = nx[i];
  return 1 + rec(na);
}
int main() {
  read_file();
  while (scanf("%d", &n) != -1) {
    for (int i = 0; i < n; i++) scanf("%d", &x[i]);
    scanf("%d%d", &a, &b);
    sort(x, x + n);
    n = unique(x, x + n) - x;
    printf("%d\n", rec(a));
  }
}
