#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void bober() {
  int n;
  cin >> n;
  vector<int> x(n);
  for (int &i : x) cin >> i;
  sort(x.begin(), x.end());
  x.erase(unique(x.begin(), x.end()), x.end());
  int a, b;
  cin >> a >> b;
  int ans = 0;
  while (a > b && !x.empty()) {
    int upd = 1;
    for (int i = x.size() - 1; i >= 0; i--) {
      if (a - a % x[i] >= b) upd = max(upd, a % x[i]);
    }
    ans++;
    a -= upd;
    while (!x.empty() && a - a % x.back() < b) x.pop_back();
  }
  ans += a - b;
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  q = 1;
  while (q--) {
    bober();
  }
  return 0;
}
