#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 1000;
int a[maxn], x, y, n, ans = 0;
set<int> ss;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ss.insert(a[i]);
  }
  n = ss.size();
  for (int i = 0; i < n; i++) {
    a[i] = *ss.begin();
    ss.erase(ss.begin());
  }
  cin >> x >> y;
  while (x > y) {
    int r = x - 1;
    for (int i = 0; i < n; i++) {
      int f = x / a[i];
      f *= a[i];
      if (f >= y)
        r = min(r, f);
      else {
        swap(a[i], a[n - 1]);
        n--;
        i--;
      }
    }
    x = r;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
