#include <bits/stdc++.h>
using namespace std;
const int N = (int)(1e5 + 5);
int main() {
  int n, a, b, num;
  vector<int> x;
  int sz;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    x.push_back(num);
  }
  sort(x.begin(), x.end());
  x.resize(unique(x.begin(), x.end()) - x.begin());
  cin >> a >> b;
  sz = x.size();
  int res = 0, curr = 0;
  while (a != b) {
    int next = !curr, newnum = a - 1;
    int idx = 0;
    for (int i = 0; i < sz; i++)
      if (a - a % x[i] >= b) {
        x[idx++] = x[i];
        newnum = min(newnum, a - a % x[i]);
      }
    a = newnum;
    res++;
    sz = idx;
  }
  cout << res << endl;
  return 0;
}
