#include <bits/stdc++.h>
using namespace std;
set<int> st;
int main() {
  int t, i, j, k, n, m;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    st.insert(x);
  }
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  set<int>::iterator it, cit;
  int ans = 0;
  while (1) {
    if (a == b) {
      cout << ans << endl;
      return 0;
    }
    int mx = 1;
    for (it = st.begin(); it != st.end();) {
      int val = *it;
      cit = it;
      it++;
      if (a - (a % val) < b) {
        st.erase(cit);
      } else {
        mx = max(mx, a % val);
      }
    }
    ans++;
    a = a - mx;
  }
  return 0;
}
