#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> V(N);
  for (int &v : V) cin >> v;
  {
    sort(V.begin(), V.end());
    set<int> S(V.begin(), V.end());
    V = vector<int>(S.begin(), S.end());
  }
  int A, B;
  cin >> A >> B;
  vector<int> T(A - B + 1);
  set<pair<int, int> > S;
  int mi = A;
  for (int v : V) {
    int nv = (A / v) * v;
    if (nv >= B) {
      S.insert(pair<int, int>(nv, v));
      mi = min(mi, nv);
    }
  }
  vector<pair<int, int> > V2(S.begin(), S.end());
  int cnt = 0;
  while (A > B) {
    cnt++;
    if (mi >= B) {
      A = min(mi, A - 1);
      vector<pair<int, int> > V3;
      for (pair<int, int> c : V2) {
        c.first = A / c.second * c.second;
        if (c.first >= B) {
          mi = min(mi, c.first);
          V3.push_back(pair<int, int>(c.first, c.second));
        }
      }
      V2 = V3;
    } else {
      A -= 1;
    }
  }
  cout << cnt << endl;
}
