#include <bits/stdc++.h>
using namespace std;
int ABS(int a) {
  if (a < 0) a = -a;
  return a;
}
int nod(int a, int b) {
  if (0 == a) return b;
  if (0 == b) return a;
  if (a == b) return a;
  return nod(a % b, b % a);
}
int main() {
  int n;
  static int x[100010];
  int i, j;
  int a, b;
  int *p;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  scanf("%d%d", &a, &b);
  sort(x, x + n);
  p = unique(x, x + n);
  n = p - x;
  int last = n - 1;
  int go = 1;
  int r = 0;
  while (a > b) {
    while (last >= 0 && a - a % x[last] < b) last--;
    go = 1;
    for (j = last; j >= 0; j--) {
      if (x[j] <= go) break;
      if (a - go > a - a % x[j] && a - a % x[j] >= b) {
        go = a % x[j];
      }
    }
    a -= go;
    r++;
  }
  cout << r << endl;
  return 0;
}
