#include <bits/stdc++.h>
using namespace std;
int a[111111];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int p, q;
  scanf("%d%d", &p, &q);
  int dap = 0;
  sort(a, a + n);
  n = unique(a, a + n) - a;
  while (p > q) {
    int temp = p - 1;
    for (int i = 0; i < n; i++) {
      int cur = p - p % a[i];
      if (cur < q)
        a[i--] = a[--n];
      else
        temp = min(temp, cur);
    }
    p = temp;
    dap++;
  }
  printf("%d", dap);
}
