#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, ans;
int a[100010], b[100010], c[100010], A, B;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  cnt = unique(a + 1, a + n + 1) - a - 1;
  scanf("%d%d", &A, &B);
  while (A > B) {
    int maxn = 0, snt = 0;
    for (int i = 1; i <= cnt; i++) {
      b[i] = A % a[i];
      if (b[i] >= maxn && A - b[i] >= B) maxn = b[i];
      if (A - b[i] >= B) {
        c[++snt] = b[i];
      }
    }
    for (int i = 1; i <= snt; i++) b[i] = c[i];
    cnt = snt;
    if (maxn > 0)
      A -= maxn;
    else
      A -= 1;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
