#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
int n, x[N];
int a, b;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i(0); i < n; ++i) cin >> x[i];
  cin >> a >> b;
  sort(x, x + n);
  n = unique(x, x + n) - x;
  int steps(0);
  while (a > b) {
    int k(a - 1);
    for (int i(0), s; i < n; ++i) {
      s = a - a % x[i];
      if (s < b)
        x[i--] = x[--n];
      else
        k = min(k, s);
    }
    a = k;
    ++steps;
  }
  cout << steps;
}
