#include <bits/stdc++.h>
using namespace std;
int N, X[100000], a, b;
int main() {
  scanf("%d", &N);
  for (int i = 0; i < (N); ++i) scanf("%d", &X[i]);
  scanf("%d%d", &a, &b);
  sort(X, X + N);
  N = unique(X, X + N) - X;
  int ans = 0;
  for (; N && a > b; ++ans) {
    int nN = 0, na = a - 1;
    for (int i = 0; i < (N); ++i) {
      int ca = (a / X[i]) * X[i];
      if (ca >= b) {
        na = min(na, ca);
        X[nN++] = X[i];
      }
    }
    N = nN;
    a = na;
  }
  if (a > b) ans += a - b;
  printf("%d\n", ans);
  return 0;
}
