#include <bits/stdc++.h>
using namespace std;
int N, A, B, a[100005];
void init() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
  scanf("%d%d", &A, &B);
}
void doit() {
  sort(a + 1, a + N + 1), N = unique(a + 1, a + N + 1) - a - 1;
  int ans = 0;
  for (; A > B;) {
    int m = A - 1;
    for (int j = 1; j <= N; j++) {
      int x = A / a[j] * a[j];
      if (x >= B)
        m = min(m, x);
      else {
        swap(a[j], a[N]), N--, j--;
      }
    }
    A = m, ans++;
  }
  printf("%d\n", ans);
}
int main() {
  init();
  doit();
  return 0;
}
