#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 100007;
const int MAX = 1000007;
int n;
int a[MAXN];
int S, T;
void init();
void input();
void work();
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  scanf("%d%d", &S, &T);
}
void work() {
  int del = S - T + 3;
  int tn = 0, mini = INF, nv;
  for (int i = 1; i <= n; ++i) {
    if (a[i] > del) {
      nv = S / a[i] * a[i];
      if (nv >= T) mini = (((mini) < (nv)) ? (mini) : (nv));
    } else
      a[++tn] = a[i];
  }
  n = tn;
  sort(a + 1, a + 1 + n);
  n = unique(a + 1, a + 1 + n) - a - 1;
  int ans = 0;
  int vs;
  while (S ^ T) {
    vs = (((S - 1) < (mini)) ? (S - 1) : (mini));
    for (int i = 1; i <= n; ++i) {
      nv = S / a[i] * a[i];
      if (nv >= T) vs = (((vs) < (nv)) ? (vs) : (nv));
    }
    S = vs;
    ++ans;
  }
  cout << ans << endl;
}
