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