#include <bits/stdc++.h>
using namespace std;
const int Nn = 100005;
int N, M, a, b, X[Nn], cnt = 0;
set<int> q;
set<int>::iterator it;
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", &X[i]);
  sort(X + 1, X + 1 + N);
  M = unique(X + 1, X + 1 + N) - X - 1;
  scanf("%d%d", &a, &b);
  while (a != b) {
    int mi = a - 1;
    for (int i = 1; i <= M; i++) {
      if (a - a % X[i] < b)
        X[i--] = X[M--];
      else
        mi = min(mi, a - a % X[i]);
    }
    a = mi;
    cnt++;
  }
  printf("%d", cnt);
  return 0;
}
