#include <bits/stdc++.h>
using namespace std;
int n, x[100005], d[1000005], a, b, s, t, u, ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  sort(x, x + n);
  int cnt = unique(x, x + n) - x;
  n = cnt;
  scanf("%d %d", &a, &b);
  if (a == b)
    printf("0");
  else {
    for (int i = 0; i <= a - b; i++) d[i] = -1;
    for (int i = n - 1; i >= 0; i--) {
      int fi = a / x[i];
      int st;
      if (b % x[i])
        st = (b / x[i]) + 1;
      else
        st = b / x[i];
      for (int j = st; j <= fi; j++)
        if (d[x[i] * j - b] == -1) d[x[i] * j - b] = x[i] - 1;
    }
    for (int i = b; i <= a; i++)
      if (d[i - b] == -1) d[i - b] = 1;
    s = b, t = b + d[0];
    ans = 1;
    while (1) {
      if (t >= a) break;
      u = t;
      for (int i = s; i <= t; i++)
        if (u < i + d[i - b]) u = i + d[i - b];
      s = t;
      t = u;
      ans++;
    }
    printf("%d\n", ans);
  }
}
