#include <bits/stdc++.h>
using namespace std;
int n;
int a, b;
int x[100005];
int y[100005];
set<int> st, st2;
set<int>::iterator it, it2;
int main() {
  cin >> n;
  int x;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    st.insert(x);
  }
  cin >> a >> b;
  int ans = 0;
  while (a > b) {
    int tmp = a - 1;
    for (it = st.begin(); it != st.end(); it++) {
      if (a - a % *it >= b) st2.insert(*it);
    }
    for (it2 = st2.begin(); it2 != st2.end(); it2++) {
      if (a - a % *it2 < tmp) tmp = a - a % *it2;
    }
    st = st2;
    st2.clear();
    a = tmp;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
