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