#include <bits/stdc++.h>
using namespace std;
const long long N = 1e2 + 300, OO = 1e8, M = 1e9 + 7, P = 6151, sq = 360,
                lg = 23;
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  set<long long> s;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    s.insert(x);
  }
  long long a, b;
  cin >> a >> b;
  long long ans = 0;
  while (a != b) {
    long long t = a - 1;
    for (auto u = s.begin(); u != s.end();) {
      long long x = *u;
      u++;
      if (a - (a % x) < b)
        s.erase(x);
      else
        t = min(t, (a - (a % x)));
    }
    a = t;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
