#include <bits/stdc++.h>
using namespace std;
const long long MAX = 123456789;
const long long inf = 1234567890;
const double EPS = 1e-10;
const double PI = 2 * asin(1.0);
const long long mod = 1e9 + 7;
inline int cmp(double x, double y = 0, double tol = EPS) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
int main() {
  int n;
  scanf("%d", &n);
  set<int> vetor;
  for (int i = 0; i < n; ++i) {
    int aux;
    scanf("%d", &aux);
    vetor.insert(aux);
  }
  int acu[1000001];
  memset(acu, -1, sizeof acu);
  int a, b;
  scanf("%d%d", &a, &b);
  set<int>::iterator it = vetor.begin();
  while (it != vetor.end()) {
    int aux = ceil((double)b / (*it));
    for (int j = aux * (*it); j <= a; j += (*it)) {
      if (acu[j - b] == -1)
        acu[j - b] = j - b - 1;
      else
        acu[j - b] = min(acu[j - b], j - b - 1);
      if (acu[min(a - b, j - b + (*it) - 1)] == -1)
        acu[min(a - b, j - b + (*it) - 1)] = j - b;
      else
        acu[min(a - b, j - b + (*it) - 1)] =
            min(acu[min(a - b, j - b + (*it) - 1)], j - b);
    }
    it++;
  }
  if (acu[a - b] == -1) acu[a - b] = a - b - 1;
  for (int i = a - b - 1; i >= 0; --i) {
    if (acu[i] == -1) {
      if (acu[i + 1] < i)
        acu[i] = acu[i + 1];
      else
        acu[i] = i - 1;
    } else {
      if (acu[i + 1] < acu[i]) acu[i] = acu[i + 1];
    }
  }
  int cont = 0;
  for (int i = a - b; i != 0; i = acu[i]) cont++;
  cout << cont << endl;
}
