#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int mod = (int)1e+9 + 7;
const double pi = acos(-1.);
const int maxn = 100100;
int x[maxn];
int z[10 * maxn];
int a, b;
void fill(int u) {
  int lpos = (u - b % u) % u;
  for (; lpos <= a - b; lpos += u) {
    z[lpos] = max(z[lpos], lpos + u - 1);
  }
}
int main() {
  srand(time(0));
  const string file = "";
  if (!file.empty()) {
    freopen((file + ".in").c_str(), "r", stdin);
    freopen((file + ".out").c_str(), "w", stdout);
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  scanf("%d%d", &a, &b);
  sort(&x[0], &x[n]);
  n = unique(&x[0], &x[n]) - &x[0];
  for (int i = 0; i < 10 * maxn; i++) {
    z[i] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    fill(x[i]);
  }
  for (int i = 1; i <= a - b; i++) {
    z[i] = max(z[i], z[i - 1]);
  }
  int cnt = 0;
  for (int i = 0; i < a - b;) {
    i = z[i];
    cnt++;
  }
  cout << cnt;
  return (0);
}
