#include <bits/stdc++.h>
using namespace std;
set<int> st1, st2;
int main() {
  int n, a, b, x, ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    st1.insert(x);
  }
  scanf("%d%d", &a, &b);
  while (a > b) {
    set<int>::iterator it;
    int aa = a - 1;
    for (it = st1.begin(); it != st1.end(); it++)
      if (a - a % (*it) >= b) {
        aa = min(a - a % (*it), aa);
        st2.insert(*it);
      }
    ans++;
    a = aa;
    st1.clear();
    st1 = st2;
    st2.clear();
  }
  printf("%d\n", ans);
}
