#include <bits/stdc++.h>
using namespace std;
int n, a[120000], m, ans, X, Y, i, j;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  n = unique(a + 1, a + n + 1) - a - 1;
  scanf("%d%d", &X, &Y);
  for (; X != Y;) {
    m = X - 1;
    for (i = 1; i <= n; ++i)
      if (X - X % a[i] >= Y) m = min(m, X - X % a[i]);
    ans++;
    X = m;
    while (n && X - X % a[n] < Y) n--;
  }
  printf("%d\n", ans);
}
