#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    s.insert(t);
  }
  int a, b;
  cin >> a >> b;
  int res = 0;
  while (a > b) {
    int mx = 1;
    set<int> toerase;
    for (set<int>::reverse_iterator it = s.rbegin(); it != s.rend(); ++it) {
      int curr = a % *it;
      if (a - curr >= b) {
        if (curr > mx) mx = curr;
      } else {
        toerase.insert(*it);
      }
      if (mx >= *it) break;
    }
    for (set<int>::iterator it = toerase.begin(); it != toerase.end(); ++it) {
      s.erase(*it);
    }
    a -= mx;
    res++;
  }
  cout << res;
  return 0;
}
