#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; ++i) cin >> x[i];
  int a, b;
  cin >> a >> b;
  sort(x, x + n);
  int j = 0;
  for (int i = 1; i < n; ++i) {
    if (x[i] > x[j]) x[++j] = x[i];
  }
  n = j + 1;
  if (a == b) {
    cout << 0 << endl;
    return 0;
  }
  int dlt = a - b + 1;
  int A[dlt], B[dlt];
  memset(B, 255, sizeof(B));
  for (int i = 0; i < dlt; ++i) A[i] = 1;
  for (int i = 0; i < n; ++i) {
    int st = ((b + x[i] - 1) / x[i]) * x[i];
    while (st <= a) {
      A[a - st] = x[i];
      st += x[i];
    }
  }
  for (int i = 0; i < dlt; ++i) {
    if (A[i] > 1)
      B[max(0, i + 1 - A[i])] = i;
    else
      B[max(0, i - 1)] = i;
  }
  int cur = B[0];
  for (int i = 1; i < dlt; ++i) cur = B[i] = max(B[i], cur);
  int u = a;
  int cnt = 0;
  while (u > b) {
    u = a - B[a - u];
    ++cnt;
  }
  cout << cnt << endl;
}
