#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = 1e9 + 7;
const int MAXN = 1e5 + 100;
int n, a, b;
vector<int> X;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    X.push_back(x);
  }
  sort(X.begin(), X.end());
  vector<int>::iterator it = unique(X.begin(), X.end());
  X.resize(distance(X.begin(), it));
  cin >> a >> b;
  int res = 0;
  int n = X.size();
  while ((n > 0) && (a - a % X[n - 1] < b)) n--;
  while (a != b) {
    int penga = a - 1;
    for (int i = 0; i < n; i++)
      if (a - a % X[i] >= b) penga = min(penga, a - a % X[i]);
    a = penga;
    res++;
    while ((n > 0) && (a - a % X[n - 1] < b)) n--;
  }
  cout << res << '\n';
}
