#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m;
int a[111111];
int main() {
  int t, i, j, k, x, y, z, ca = 1, re = 0;
  scanf("%d", &(n));
  for (int i = 0; i < (int)(n); ++i) scanf("%d", &(a[i]));
  scanf("%d%d", &(x), &(y));
  sort(a, a + n);
  n = unique(a, a + n) - a;
  while (x > y) {
    int tt = x - 1;
    for (int i = 0; i < (int)(n); ++i) {
      if (x - x % a[i] < y) {
        a[i] = a[n - 1];
        n--;
        i--;
      } else if (x - x % a[i] < tt) {
        tt = x - x % a[i];
      }
    }
    x = tt;
    re++;
  }
  printf("%d\n", (re));
  return 0;
}
