#include <bits/stdc++.h>
using namespace std;
const int MN = 100010;
const int MD = 1000010;
int a, b, d;
int n;
int x[MN];
int nextt[MD], jump[MD];
void get_jump(int x) {
  int init = 0;
  if (a % x) init = a - a % x + x - a;
  for (int i = init; i < d; i += x) jump[i] = max(jump[i], x - 1);
}
int main(void) {
  scanf("%d", &n);
  int i;
  for ((i) = 0; (i) < (int)(n); (i)++) scanf("%d", x + i);
  scanf("%d %d", &b, &a);
  d = b - a + 1;
  for ((i) = 0; (i) < (int)(d); (i)++) jump[i] = 1;
  sort(x, x + n);
  for ((i) = 0; (i) < (int)(n); (i)++)
    if (i == 0 || x[i] != x[i - 1]) get_jump(x[i]);
  for (int i = 0; i < d; ++i) {
    nextt[i] = i + jump[i];
    if (i) nextt[i] = max(nextt[i], nextt[i - 1]);
  }
  int ans = 0;
  int cur = 0;
  while (cur + 1 < d) {
    ++ans, cur = nextt[cur];
  }
  printf("%d\n", ans);
  return 0;
}
