#include <bits/stdc++.h>
using namespace std;
int n;
int a[100010];
int x, y;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  scanf("%d%d", &x, &y);
  if (x < a[0]) {
    if (y != 0)
      printf("%d\n", x - y);
    else {
      if (x != y)
        printf("%d\n", 1);
      else
        printf("%d\n", 0);
    }
    return 0;
  }
  int num = 0;
  while (x > y) {
    int sub = 0;
    int min = 0x7fffffff;
    int now = upper_bound(a, a + n, sub + 1) - a;
    for (int i = now; i < n;) {
      int tmp = x % a[i];
      if (tmp > sub && tmp <= x - y) {
        sub = tmp;
      }
      if (tmp < min) min = tmp;
      if (a[i] > x) break;
      i = upper_bound(a + i, a + n, a[i]) - a;
    }
    if (min > x - y) {
      num += x - y;
      break;
    }
    if (sub != 0)
      x -= sub;
    else
      x -= 1;
    num++;
  }
  printf("%d\n", num);
}
