#include <bits/stdc++.h>
using namespace std;
int x[100000];
int main() {
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  cin >> a >> b;
  sort(x, x + n);
  n = unique(x, x + n) - x;
  int moves = 0;
  while (a > b) {
    while (n && a - a % x[n - 1] < b) n--;
    int nextA = a - 1;
    for (int i = n - 1; i >= 0 && a - x[i] + 1 < nextA; i--) {
      int to = a - a % x[i];
      if (to < nextA && to >= b) nextA = to;
    }
    a = nextA;
    moves++;
  }
  cout << moves;
}
