#include <bits/stdc++.h>
using namespace std;
int foi[1000002];
int e[1000002];
vector<int> v, nv;
int main() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 0; i < n; i++) {
    int e;
    scanf(" %d", &e);
    if (s.find(e) == s.end()) {
      v.push_back(e);
      s.insert(e);
    }
  }
  int a, b;
  scanf(" %d %d", &a, &b);
  int ans = 0;
  while (a != b) {
    nv.clear();
    int na = a - 1;
    for (int i = 0; i < v.size(); i++) {
      if (a - (a % v[i]) >= b) {
        nv.push_back(v[i]);
        na = min(na, a - a % v[i]);
      }
    }
    a = na;
    v = nv;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
