#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 10;
vector<int> x[2];
vector<int>::iterator it;
int main() {
  int n, a, b;
  scanf("%d", &n);
  x[0].clear();
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    x[0].push_back(a);
  }
  sort(x[0].begin(), x[0].end());
  it = unique(x[0].begin(), x[0].end());
  x[0].erase(it, x[0].end());
  scanf("%d%d", &a, &b);
  int ans = 0;
  for (int c1 = 0, c2; a > b; c1 = c2) {
    c2 = (c1 + 1) & 1;
    int tmp = a - 1;
    x[c2].clear();
    for (it = x[c1].begin(); it != x[c1].end(); it++)
      if (a - a % (*it) >= b) {
        x[c2].push_back(*it);
        tmp = min(tmp, a - a % (*it));
      }
    a = tmp;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
