#include <bits/stdc++.h>
using namespace std;
int N, A, B;
int X[100000];
int nxt[1000001];
int main() {
  scanf("%d", &N);
  for (int(i) = 0; (i) < (N); (i)++) scanf("%d", &X[i]);
  sort(X, X + N);
  N = unique(X, X + N) - X;
  scanf("%d%d", &B, &A);
  int d = B - A;
  for (int(i) = 0; (i) < (d + 1); (i)++) nxt[i] = i + A + 1;
  for (int(i) = 0; (i) < (N); (i)++)
    for (int j = (A + X[i] - 1) / X[i] * X[i]; j <= B; j += X[i])
      nxt[j - A] = max(nxt[j - A], j + X[i] - 1);
  for (int(i) = (1); (i) < (d + 1); (i)++) nxt[i] = max(nxt[i], nxt[i - 1]);
  int now = A, ans = 0;
  while (now < B) {
    now = nxt[now - A];
    ans++;
  }
  printf("%d\n", ans);
}
