#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = (1 << 30) - 1;
const int MAXN = 100010;
int n;
int A, B, x[MAXN];
int mp[1000010];
int main() {
  clock_t st, ed;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", x + i);
  sort(x + 1, x + n + 1);
  scanf("%d%d", &A, &B);
  for (int i = B; i <= A; ++i) mp[i - B] = i + 1;
  for (int i = 1; i <= n; ++i) {
    if (i > 1 && x[i] == x[i - 1]) continue;
    int p = B / x[i] * x[i];
    if (p < B) p += x[i];
    while (p < A) {
      mp[p - B] = max(mp[p - B], p + x[i] - 1);
      p += x[i];
    }
  }
  int cnt = 0, p = B, nxt_tp = -1, tp = mp[p - B];
  while (p < A) {
    p++;
    nxt_tp = max(nxt_tp, mp[p - B]);
    if (p == tp || p == A) {
      cnt++;
      tp = nxt_tp;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
