#include <bits/stdc++.h>
using namespace std;
int N, X[100010], A, B;
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &X[i]);
  }
  sort(X, X + N);
  N = unique(X, X + N) - X;
  scanf("%d %d", &A, &B);
  int ans = 0;
  while (A > B) {
    int d = 1;
    for (int i = 0; i < N; i++) {
      if (A - A % X[i] >= B) {
        d = max(d, A % X[i]);
      }
    }
    while (N && A - A % X[N - 1] < B) {
      N--;
    }
    A -= d;
    ans++;
  }
  printf("%d\n", ans);
}
