#include <bits/stdc++.h>
using namespace std;
int n, a, b, t, k, x[(int)1e6], i, s;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) cin >> x[i];
  sort(x, x + n), n = unique(x, x + n) - x;
  cin >> a >> b;
  while (a > b) {
    k = a - 1;
    for (i = 0; i < n; i++)
      if ((s = a - a % x[i]) < b)
        x[i--] = x[--n];
      else
        k = min(k, s);
    a = k, t++;
  }
  cout << t;
}
