#include <bits/stdc++.h>
using namespace std;
int n, num[100005], a, b;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> num[i];
  cin >> a >> b;
  sort(num, num + n);
  int len = unique(num, num + n) - num;
  int ans = 0, tmp;
  while (a > b) {
    tmp = a - 1;
    for (int i = 0; i < len; i++) {
      int tmpp = a - a % num[i];
      if (tmpp < b)
        num[i--] = num[--len];
      else
        tmp = min(tmp, tmpp);
    }
    a = tmp;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
