#include <bits/stdc++.h>
using namespace std;
int n, x, y;
vector<int> a;
void init() {
  scanf("%d", &n);
  a.assign(n, 0);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  scanf("%d%d", &x, &y);
}
void solve() {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  int ans = 0;
  while (x > y) {
    int ma = 1;
    for (int i = 0; i < a.size(); i++)
      if (x - x % a[i] >= y) ma = max(ma, x % a[i]);
    x -= ma;
    ans++;
    while (a.size() > 0 && (x - x % a[a.size() - 1] < y)) a.pop_back();
  }
  printf("%d", ans);
}
int main() {
  init();
  solve();
  return 0;
}
