#include <bits/stdc++.h>
using namespace std;
int n, tmp, tmp1, a, b, sum = 0;
vector<int> v;
int x[100001];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  sort(x, x + n);
  n = unique(x, x + n) - x;
  for (int i = 0; i < n; i++) {
    v.push_back(x[i]);
  }
  cin >> a >> b;
  while (a != b) {
    tmp = a - 1;
    for (int i = v.size() - 1; i >= 0; i--) {
      tmp1 = a - (a % v[i]);
      if (tmp1 < b) {
        v.erase(v.begin() + i);
      } else {
        tmp = min(tmp, tmp1);
      }
    }
    a = tmp;
    sum++;
  }
  cout << sum << endl;
  return 0;
}
