#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
static inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static inline void amax(T &x, U y) {
  if (x < y) x = y;
}
double pi = 3.141592653589793238;
const int M = 1000000007;
const int Nmax = 5005;
const int MM = 998244353;
const int N = 1000050;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int T = 1;
  while (T--) {
    long long int n, a, b;
    cin >> n;
    long long int x[n];
    for (long long int i = 0; i < n; i++) {
      cin >> x[i];
    }
    sort(x, x + n);
    n = unique(x, x + n) - x;
    cin >> a >> b;
    long long int ans = 0;
    while (a != b) {
      long long int next = a - 1;
      for (int i = 0; i < n; i++) {
        long long int y = x[i];
        if (a - (a % y) < b)
          x[i--] = x[--n];
        else {
          long long int k = a - a % y;
          next = min(next, k);
        }
      }
      a = next;
      ans++;
    }
    cout << ans << "\n";
  }
  return 0;
}
