#include <bits/stdc++.h>
using namespace std;
int n;
int A, B;
vector<int> num;
vector<int> new_num;
map<int, int> countx;
int main() {
  cin >> n;
  int x;
  for (int i = 0; i < (n); i++) {
    cin >> x;
    if (countx.count(x) == 0) {
      countx[x] = 1;
      num.push_back(x);
    }
  }
  cin >> A >> B;
  int ans = 0;
  while (A != B) {
    int nexts = A - 1;
    new_num.clear();
    for (int i = 0; i < (((int)(num).size())); i++) {
      int x = num[i];
      int y = A / x * x;
      if (y >= B) {
        new_num.push_back(x);
        if (nexts > y) {
          nexts = y;
        }
      }
    }
    num = new_num;
    A = nexts;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
