#include <bits/stdc++.h>
int sf(const void* a, const void* b) {
  return *((const int*)a) - *((const int*)b);
}
int x[100000];
int y[100000];
int main() {
  int i;
  int n;
  int m;
  int a;
  int b;
  int max;
  int start;
  int r = 0;
  scanf("%d", &m);
  for (i = 0; i < m; i++) scanf("%d", &y[i]);
  qsort(y, m, sizeof(int), sf);
  n = 0;
  for (i = 0; i < m; i++)
    if (i == 0 || y[i] != y[i - 1]) x[n++] = y[i];
  scanf("%d%d", &a, &b);
  start = n - 1;
  while (a > b) {
    max = 1;
    for (i = start; i >= 0 && x[i] > max + 1; i--) {
      if (a - (a % x[i]) >= b) {
        if (a % x[i] > max) max = a % x[i];
      } else
        start = i - 1;
    }
    a -= max;
    r++;
  }
  printf("%d\n", r);
  return 0;
}
