#include <bits/stdc++.h>
using namespace std;
int a, b, n, ara[100005];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &ara[i]);
  scanf("%d %d", &a, &b);
  sort(ara, ara + n);
  n = unique(ara, ara + n) - ara;
  int cnt = 0;
  while (a > b) {
    while (n > 0 and ara[n - 1] > a) {
      n--;
    }
    int mn = a - 1;
    for (int i = 0; i < n; i++) {
      int temp = ((a / ara[i]) * ara[i]);
      if (temp >= b) mn = min(mn, temp);
    }
    cnt++;
    a = mn;
    while (n > 0 and ((a / ara[n - 1]) * ara[n - 1]) < b) {
      n--;
    }
  }
  printf("%d\n", cnt);
}
