#include <bits/stdc++.h>
inline long long gcd(long long a, long long b) {
  return (b ? gcd(b, a % b) : a);
}
inline long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
inline int cmp(double x, double y = 0, double tol = 1e-7) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
using namespace std;
const int MAXN = 1000010;
int g[MAXN];
int x, a, b;
int main() {
  for (int i = 0; i < MAXN - 1; i++) {
    g[i] = i + 1;
  }
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  cin >> a >> b;
  for (int i = 0; i < n; i++) {
    if (i == 0 || v[i] != v[i - 1]) {
      if (b % v[i] == 0)
        x = b;
      else
        x = ((int)ceil(b * 1.0 / v[i])) * v[i];
      while (x <= a) {
        g[x - b] = max(g[x - b], x - b + v[i] - 1);
        x += v[i];
      }
    }
  }
  for (int i = 1; i < MAXN - 1; i++) g[i] = max(g[i], g[i - 1]);
  x = 0;
  int ans = 0;
  while (x < a - b) {
    x = g[x];
    ans++;
  }
  cout << ans << endl;
}
