#include <bits/stdc++.h>
using namespace std;
void _fill_int(int* p, int val, int rep) {
  int i;
  for (i = 0; i < rep; i++) p[i] = val;
}
int GETi() {
  int i;
  scanf("%d", &i);
  return i;
}
template <class T>
T sqr(T val) {
  return val * val;
}
int N, A, B;
vector<int> X;
void solve() {
  int f, r, i, j, k, l, x, y, z, tx, ty;
  cin >> N;
  for (i = 0; i < N; i++) X.push_back(GETi());
  cin >> A >> B;
  sort(X.begin(), X.end());
  X.erase(unique(X.begin(), X.end()), X.end());
  z = 0;
  for (; A > B;) {
    y = 1;
    j = X.size();
    for (i = X.size() - 1; i >= 0; i--) {
      x = A % X[i];
      if (A - x < B) {
        swap(X[i], X[j - 1]);
        j--;
      } else
        y = max(x, y);
    }
    X.resize(j);
    A -= y;
    z++;
  }
  printf("%d\n", z);
  return;
}
int main(int argc, char** argv) {
  if (argc > 1) freopen(argv[1], "r", stdin);
  solve();
  return 0;
}
