#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010000;
int x[maxn];
int main() {
  int n, a, b;
  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 ans = 0;
  while (a > b) {
    int next = a - 1;
    for (int i = 0; i < n; i++) {
      int to = a - a % x[i];
      if (to < b)
        x[i--] = x[--n];
      else if (to < next)
        next = to;
    }
    a = next;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
