#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  int a, b;
  cin >> a >> b;
  int step = 0;
  while (a != b) {
    int k = a - 1;
    for (int i = v.size() - 1; i >= 0 && v[i] > a - k; --i) {
      int m = a - a % v[i];
      if (m >= b && m < k) k = m;
    }
    while (!v.empty() && a - a % v.back() < b) v.pop_back();
    a = k;
    ++step;
  }
  cout << step << endl;
  return 0;
}
