#include <bits/stdc++.h>
using namespace std;
int N, a, b;
int temp;
int main() {
  scanf("%d", &N);
  vector<int> x;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &temp);
    x.push_back(temp);
  }
  sort(x.begin(), x.end());
  x.resize(distance(x.begin(), unique(x.begin(), x.end())));
  scanf("%d%d", &a, &b);
  int res = 0;
  while (a > b) {
    vector<int> xNew;
    int bestA = a - 1;
    int step;
    for (int i = 0; i < x.size(); ++i) {
      step = (a / x[i]) * x[i];
      if (step >= b) {
        bestA = min(bestA, step);
        xNew.push_back(x[i]);
      }
    }
    x = xNew;
    a = bestA;
    res++;
  }
  printf("%d", res);
  return 0;
}
