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