#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, A, B;
  while (cin >> n) {
    vector<int> a, b;
    while (n--) {
      int p;
      cin >> p;
      a.push_back(p);
    }
    int ans = 0;
    cin >> A >> B;
    sort(a.begin(), a.end());
    a.resize(unique(a.begin(), a.end()) - a.begin());
    while (A != B) {
      int t1 = A - 1;
      int len = a.size();
      b.clear();
      for (int i = 0; i < len; i++) {
        int t = A / a[i] * a[i];
        if (t >= B) {
          t1 = min(t, t1);
          b.push_back(a[i]);
        }
      }
      a = b;
      A = t1;
      ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
