#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:640000000")
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int maxn = (int)1e5 + 10;
const int maxd = (int)1e6 + 10;
int first[maxn], ma[maxd], dist[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &first[i]);
  }
  int a, b;
  cin >> a >> b;
  if (a == b) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i <= a - b; i++) {
    ma[i] = 2;
  }
  sort(first, first + n);
  n = unique(first, first + n) - first;
  for (int i = 0; i < n; i++) {
    int lo = (b + first[i] - 1) / first[i] * first[i];
    while (lo <= a) {
      ma[lo - b] = first[i];
      lo += first[i];
    }
  }
  int curDist = 0;
  int l = 0;
  int r = 1;
  while (true) {
    int MA = r;
    while (l < r) {
      MA = max(MA, l + ma[l]);
      l++;
    }
    curDist++;
    r = MA;
    if (r > a - b) {
      cout << curDist << endl;
      return 0;
    }
  }
  return 0;
}
