#include <bits/stdc++.h>
using namespace std;
void scan(int &aa) {
  char ch;
  bool bb;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  ch == '-' ? (bb = 1, aa = 0) : (bb = 0, aa = ch - '0');
  while (ch = getchar(), ch >= '0' && ch <= '9') aa = aa * 10 + ch - '0';
  bb ? aa = -aa : 0;
}
inline int dmin(int x, int y) { return x < y ? x : y; }
inline int dmax(int x, int y) { return x > y ? x : y; }
inline void cmin(int &x, int y) { x > y ? x = y : 0; }
inline void cmax(int &x, int y) { x < y ? x = y : 0; }
inline void mswap(int &x, int &y) {
  int o = x;
  x = y;
  y = o;
}
inline int mabs(int x) { return x < 0 ? -x : x; }
int N, A[100010], a, b;
int main() {
  scan(N);
  for (register int i = 1; i <= N; ++i) scan(A[i]);
  scan(a), scan(b);
  sort(A + 1, A + N + 1);
  N = unique(A + 1, A + N + 1) - A - 1;
  int Sum = 0;
  while (a > b) {
    int t = a - 1;
    for (register int i = 1; i <= N; ++i) {
      if (a - a % A[i] < b)
        A[i--] = A[N--];
      else
        cmin(t, a - a % A[i]);
    }
    a = t;
    Sum++;
  }
  printf("%d\n", Sum);
  return 0;
}
