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