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