#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
set<int> s;
set<int>::iterator it;
int main() {
  int n, i, x, y;
  long long j;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    s.insert(a[i]);
  }
  cin >> x >> y;
  int ans = 0;
  int mi, e;
  while (y != x) {
    mi = x - 1;
    for (it = s.begin(); it != s.end();) {
      e = *it;
      it++;
      if (x - (x % e) < y) {
        s.erase(e);
        continue;
      }
      mi = min(mi, x - (x % e));
    }
    x = mi;
    ans++;
  }
  cout << ans << endl;
}
