#include <bits/stdc++.h>
using namespace std;
int n, a, b, x[100005], d[1000006];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  cin >> a >> b;
  swap(a, b);
  for (int i = a; i <= b; i++) d[i - a] = 2;
  sort(x, x + n);
  n = unique(x, x + n) - x;
  for (int i = 0; i < n; i++) {
    int cur = a - a % x[i];
    if (cur < a) cur += x[i];
    while (cur <= b) {
      d[cur - a] = x[i];
      cur += x[i];
    }
  }
  int l = a, r = a + 1, r2, t = 0;
  while (r <= b) {
    t++;
    r2 = r + 1;
    for (int i = l; i < r; i++) r2 = max(r2, i + d[i - a]);
    l = r;
    r = r2;
  }
  cout << t;
  return 0;
}
