#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, a, b;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  cin >> a >> b;
  sort(x.begin(), x.end());
  x.erase(unique((x).begin(), (x).end()), x.end());
  int ret = 0;
  while (a > b) {
    int c = a - 1;
    for (int i = 0; i < (int)(x.size()); i++) {
      int tmp = a / x[i] * x[i];
      if (tmp >= b) {
        c = min(c, tmp);
      } else {
        swap(x[i], x.back());
        x.pop_back();
        --i;
      }
    }
    a = c;
    ++ret;
  }
  cout << ret << endl;
  return 0;
}
