#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
const int INF = 1000000008;
int x[maxn];
inline void solve(void) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  sort(x, x + n);
  int id = 1;
  for (int i = 1; i < n; i++)
    if (x[i] != x[i - 1]) x[id++] = x[i];
  n = id;
  int a, b;
  int res = 0;
  scanf("%d%d", &a, &b);
  while (a > b) {
    int max_sub = 1;
    for (int i = n - 1; i >= 0; i--) {
      if (a - a % x[i] >= b) max_sub = max(max_sub, a % x[i]);
    }
    a -= max_sub;
    res++;
    while (n > 1 && (a - a % x[n - 1] < b)) n--;
  }
  printf("%d\n", res);
}
int main(int argc, const char* argv[]) {
  solve();
  return 0;
}
