#include <bits/stdc++.h>
int n, x[100005], a, b;
int main(int argc, char *argv[]) {
  int i, t, tt, ans;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &x[i]);
  scanf("%d%d", &a, &b);
  std::sort(x, x + n, std::greater<int>());
  n = std::unique(x, x + n) - x;
  ans = 0;
  while (a != b) {
    tt = a - 1;
    for (i = 0; i < n; i++) {
      t = a - (a % x[i]);
      if (t < b)
        x[i--] = x[--n];
      else
        tt = ((t) < (tt) ? (t) : (tt));
    }
    a = tt;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
