#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 20, MAX = 1e6 + 20, INF = 2e9;
int n, a, b, x[N], y[N], to[MAX], cnt, now, mn = INF;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> y[i];
  sort(y, y + n);
  for (int i = 0; i < n; i++)
    if (!i || y[i] != y[i - 1]) x[cnt++] = y[i];
  n = cnt;
  cnt = 0;
  cin >> a >> b;
  for (int i = b + 1; i <= a; i++) to[i - b] = i - 1;
  for (int i = 0; i < n; i++)
    for (int j = b - (b % x[i]) + x[i]; j <= a; j += x[i])
      if (j - x[i] >= b) to[j - b] = min(to[j - b], j - x[i]);
  now = a;
  for (int i = 0; i < n; i++)
    if (a - (a % x[i]) >= b) mn = min(mn, a - (a % x[i]));
  for (int i = a; i > b; i--) {
    if (now == i) {
      now = min(now - 1, mn);
      cnt++;
    }
    mn = min(mn, to[i - b]);
  }
  if (now != b) cout << now << ' ' << b << endl;
  return cout << cnt << endl, 0;
}
