#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 1e6 + 17;
int a[100007];
pair<int, int> b[N], c[N];
int f[N];
int main() {
  int n, A, B;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  scanf("%d%d", &A, &B);
  sort(a + 1, a + 1 + n);
  n = unique(a + 1, a + 1 + n) - a - 1;
  for (int i = n; i >= 1; --i) {
    int l = ceil(1. * B / a[i]), r = floor(1. * A / a[i]);
    for (int j = l; j <= r; ++j) {
      if (c[j * a[i] - B].first) continue;
      c[j * a[i] - B] = pair<int, int>(j * a[i], min((j + 1) * a[i] - 1, A));
    }
  }
  int tot = 0;
  for (int i = B; i <= A; ++i)
    if (c[i - B].first) {
      b[++tot] = c[i - B];
    }
  int m = 1;
  c[1] = b[1];
  for (int i = 2; i <= tot; ++i) {
    if (c[m].first <= b[i].first && b[i].second <= c[m].second) continue;
    c[++m] = b[i];
  }
  for (int i = B; i <= A; ++i) f[i - B] = i;
  int kk = B;
  for (int i = 1; i <= m; ++i) {
    for (kk = max(kk, c[i].first); kk <= c[i].second; ++kk)
      f[kk - B] = c[i].first;
  }
  int ans = 0;
  while (A > B) {
    if (f[A - B] == A)
      A--;
    else
      A = f[A - B];
    ans++;
  }
  cout << ans << endl;
}
