#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
inline int read(int &n) {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + (c - '0');
    c = getchar();
  }
  return n = x * f;
}
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int N = 1e6 + 7;
int a[N];
set<int> cur;
int n, x, y;
int input;
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", &input);
    cur.insert(input);
  }
  scanf("%d%d", &x, &y);
  int ans = 0;
  set<int>::iterator it;
  while (x > y) {
    int cnt = x - 1;
    for (it = cur.begin(); it != cur.end();) {
      int u = *it;
      it++;
      if (x - (x % u) < y) {
        cur.erase(u);
      } else
        cnt = min(cnt, x - (x % u));
    }
    x = cnt;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
