#include <bits/stdc++.h>
using namespace std;
const long double PI = 2 * acos(0);
const long double eps = 1e-15;
const int inf = 1e9 + 7;
const long long Linf = (long long)1e18 + 7;
const int MOD = 1e9 + 7;
const int LMAX = 1e6 + 7;
const int MAX = 1e5 + 7;
const int BASE = 1e9 + 7;
int dx[] = {-1, 0, 0, 1};
int dy[] = {0, -1, 1, 0};
int x[100001], a, b, n, res;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = (1); i <= (n); i++) {
    cin >> x[i];
  }
  cin >> a >> b;
  sort(x + 1, x + n + 1);
  n = unique(x + 1, x + n + 1) - x - 1;
  while (a > b) {
    int mx = 1;
    for (int i = (1); i <= (n); i++) {
      if (a - a % x[i] >= b) {
        mx = max(mx, a % x[i]);
      }
    }
    a -= mx;
    while (n && a - a % x[n] < b) n--;
    res++;
  }
  cout << res;
  return 0;
}
