#include <bits/stdc++.h>
using namespace std;
int n, x[100123], a, b, ans, mx, id, step[1000123];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x[i];
  cin >> a >> b;
  sort(x + 1, x + n + 1);
  n = unique(x + 1, x + n + 1) - x - 1;
  for (int i = b; i <= a; i++) step[i - b] = 2;
  for (int i = 1; i <= n; i++) {
    int j = b - b % x[i];
    if (j < b) j += x[i];
    for (int k = j; k <= a; k += x[i]) step[k - b] = x[i];
  }
  int l = b, r = b + 1, j = 0;
  while (r <= a) {
    j = r + 1;
    for (int i = l; i < r; i++) {
      j = max(j, step[i - b] + i);
    }
    l = r, r = j;
    ans++;
  }
  cout << ans;
  return 0;
}
