#include <bits/stdc++.h>
using namespace std;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
set<int> X, Y;
int main(int argc, char* argv[]) {
  io();
  int n;
  cin >> n;
  int a, b;
  for (int i = 0; i < n; i++) {
    cin >> a;
    X.insert(a);
  }
  cin >> a >> b;
  int ans = 0;
  while (a > b) {
    ans++;
    Y.clear();
    int mn = a - 1;
    for (auto it : X) {
      if ((a - b) >= (a % it)) {
        mn = min(mn, (a - a % it));
        Y.insert(it);
      }
    }
    X = Y;
    a = mn;
  }
  cout << ans << '\n';
  return 0;
}
