#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, ans = 0, max = 0;
  cin >> n;
  int x[n], ar[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  cin >> a >> b;
  sort(x, x + n);
  int j = 0;
  for (int i = 0; i < n - 1; i++) {
    if (x[i] != x[i + 1]) ar[j] = x[i], j++;
  }
  ar[j] = x[n - 1], j++;
  n = j;
  while (a > b) {
    int flag = 0;
    max = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (ar[i] < max) break;
      if (a % ar[i] != 0 && a - (a % ar[i]) >= b) {
        if (max < (a % ar[i])) max = (a % ar[i]);
      }
    }
    if (max != 0)
      a = a - max, ans++;
    else
      a = a - 1, ans++;
    for (int i = n - 1; i >= 0; i--) {
      if (a - a % ar[i] < b)
        n--;
      else
        break;
    }
  }
  cout << ans << endl;
  return 0;
}
