#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
struct intervalac {
  vector<int> strom;
  int offst;
  intervalac(int sz) {
    for (offst = 1; offst < sz; offst *= 2)
      ;
    strom.resize(offst * 2, 1023456789);
  }
  void setni(int ind, int val) {
    ind += offst;
    strom[ind] = val;
    for (ind /= 2; ind > 0; ind /= 2) {
      strom[ind] = min(strom[ind * 2], strom[ind * 2 + 1]);
    }
  }
  int get(int a, int b, int node = 1, int range = 0) {
    if (node == 1) range = offst;
    if (b <= 0 || a >= range) return 1023456789;
    if (a <= 0 && b >= range) return strom[node];
    return min(get(a, b, node * 2, range / 2),
               get(a - range / 2, b - range / 2, node * 2 + 1, range / 2));
  }
  void prnt() {
    for (int i = 0; i < strom.size(); i++) printf("%d\t", strom[i]);
    printf("\n");
  }
};
int main() {
  int n;
  scanf("%d", &n);
  vector<int> x(n);
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  sort(x.begin(), x.end());
  int a, b;
  scanf("%d %d", &a, &b);
  intervalac cena(a - b + 1);
  cena.setni(a - b, 0);
  vector<int> najsamlepsi(a - b, 2);
  for (int i = 0; i < n; i++) {
    if (i > 0) {
      if (x[i] == x[i - 1]) continue;
    }
    int pom;
    if (b % x[i] == 0)
      pom = b;
    else
      pom = b - (b % x[i]) + x[i];
    for (; pom < a; pom += x[i]) {
      najsamlepsi[pom - b] = x[i];
    }
  }
  for (int i = a - b - 1; i >= 0; i--) {
    cena.setni(i, 1 + cena.get(i + 1, min(i + najsamlepsi[i], a - b + 1)));
  }
  printf("%d\n", cena.get(0, 1));
  return 0;
}
