#include <bits/stdc++.h>
const int MAX_N = 100100;
const int SPAN = 1000100;
int n, x[MAX_N], c[SPAN], dp[SPAN];
int lo, hi;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &x[i]);
  scanf("%d%d", &hi, &lo);
  std::sort(x, x + n);
  n = std::unique(x, x + n) - x;
  for (int i = n - 1; i >= 0; --i)
    for (int it = hi - hi % x[i]; it >= lo; it -= x[i])
      if (c[it - lo] == 0) c[it - lo] = x[i];
  dp[0] = 0;
  int cur = 0;
  for (int i = 1; i + lo <= hi; ++i) {
    for (; cur + c[cur] <= i && cur < i; cur++)
      ;
    dp[i] = cur;
  }
  int ans = 0;
  for (int i = hi - lo; i > 0; ans++) {
    if (dp[i] < i)
      i = dp[i];
    else
      i--;
  }
  printf("%d\n", ans);
  return 0;
}
