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