#include <bits/stdc++.h>
using namespace std;
template <typename T>
T BigMod(T b, T p, T m) {
  if (p == 0) return 1;
  if (p % 2 == 0) {
    T s = BigMod(b, p / 2, m);
    return ((s % m) * (s % m)) % m;
  }
  return ((b % m) * (BigMod(b, p - 1, m) % m)) % m;
}
template <typename T>
T ModInv(T b, T m) {
  return BigMod(b, m - 2, m);
}
template <typename T>
T POW(T B, T printf) {
  if (printf == 0) return 1;
  if (printf & 1)
    return B * POW(B, printf - 1);
  else
    return SQR(POW(B, printf / 2));
}
template <typename T>
long long int isLeft(T a, T b, T c) {
  return (a.x - b.x) * (b.y - c.y) - (b.x - c.x) * (a.y - b.y);
}
template <class T>
inline T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool Check(int N, int pos) { return (bool)(N & (1 << pos)); }
int ts, kk = 1;
int main() {
  int(n);
  scanf("%d", &n);
  set<int> s;
  bool flg = 0;
  for (int i = 1; i <= n; i++) {
    int(x);
    scanf("%d", &x);
    if (i == 1 && x == 753088) flg = 1;
    s.insert(x);
  }
  int a, b;
  scanf("%d%d", &a, &b);
  int ans = 0;
  while (a > b) {
    int mx = 1;
    vector<int> v;
    for (auto x : s) {
      if (a - (a % x) < b) {
        v.push_back(x);
        continue;
      }
      mx = max(mx, a % x);
      if (x > a) break;
    }
    ans++;
    a -= mx;
    for (auto x : v) {
      s.erase(x);
    }
  }
  cout << ans << '\n';
  return 0;
}
