#include <bits/stdc++.h>
using namespace std;
set<int> m;
int a, b, n, z;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &z), m.insert(z);
  scanf("%d", &b), scanf("%d", &a);
  int out = 0;
  while (b > a) {
    ++out;
    int bst = b - 1;
    vector<int> del;
    for (set<int>::iterator it = m.begin(); it != m.end(); ++it) {
      int temp = b - b % (*it);
      if (temp < a) {
        del.push_back(*it);
        continue;
      }
      bst = min(bst, temp);
    }
    for (int i = 0; i < del.size(); ++i) m.erase(del[i]);
    b = bst;
  }
  cout << out;
}
