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