#include <bits/stdc++.h>
using namespace std;
int ar[1000111];
int n;
vector<int> v;
map<int, int> occ;
vector<int> newv;
int solve(int a, int b) {
  for (int i = 0; i < n; i++) {
    if (occ[ar[i]] == 0) v.push_back(ar[i]);
    occ[ar[i]] = 1;
  }
  int cnt = 0;
  while (a > b) {
    newv.clear();
    int besta = a - 1;
    for (int i = 0; i < v.size(); i++) {
      if (a - (a % v[i]) >= b) {
        newv.push_back(v[i]);
        besta = min(besta, a - (a % v[i]));
      }
    }
    a = besta;
    v = newv;
    cnt++;
  }
  return cnt;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  int a, b;
  cin >> a >> b;
  cout << solve(a, b) << endl;
  return 0;
}
