#include <bits/stdc++.h>
using namespace std;
vector<int> v1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n; i += 1) {
    int x;
    cin >> x;
    v1.push_back(x);
  }
  cin >> a >> b;
  sort(v1.begin(), v1.end());
  n = unique(v1.begin(), v1.end()) - v1.begin();
  int ans = 0;
  while (a > b) {
    while (n and a - a % v1[n - 1] < b) {
      n -= 1;
    }
    int nextA = a - 1;
    for (int i = n - 1; i >= 0 and a - v1[i] + 1 < nextA; i -= 1) {
      int to = a - (a % v1[i]);
      if (to < nextA and to >= b) {
        nextA = to;
      }
    }
    a = nextA;
    ans += 1;
  }
  cout << ans << endl;
  return 0;
}
