#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n;
  int a, b;
  scanf("%d", &n);
  set<int> s;
  s.clear();
  for (int i = (1); i <= (n); i++) {
    int x;
    scanf("%d", &x);
    s.insert(x);
  }
  scanf("%d%d", &a, &b);
  int ans = 0;
  vector<int> x;
  for (typeof((s).begin()) it = (s).begin(); it != (s).end(); it++)
    x.push_back(*it);
  while (a > b) {
    vector<int> nx;
    int _max = 1;
    for (typeof((x).begin()) it = (x).begin(); it != (x).end(); it++) {
      int sub = a % (*it);
      if (a - sub >= b) {
        _max = max(_max, sub);
        nx.push_back(*it);
      }
    }
    a -= _max;
    ans++;
    x = nx;
  }
  printf("%d\n", ans);
  return 0;
}
