#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int x[N], best[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  int a, b;
  cin >> a >> b;
  swap(a, b);
  sort(x, x + n);
  n = unique(x, x + n) - x;
  for (int i = 0; i < n; i++) {
    int s = (a + x[i] - 1) / x[i], e = b / x[i];
    for (int t = s; t <= e; t++) {
      if (t != s) best[(t * x[i] - 1) - a] = x[i] - 1;
      if (t == e) best[(b)-a] = max(best[(b)-a], b - t * x[i]);
    }
  }
  for (int i = b - a; i >= 0; i--) {
    best[i] = max(best[i], best[i + 1] - 1);
    best[i] = max(best[i], 1);
  }
  int res = 0;
  b -= a;
  while (b) {
    res++;
    b -= best[b];
  }
  cout << res << endl;
}
