#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200777216")
using namespace std;
int ans[1100000];
int main() {
  int n;
  cin >> n;
  int a[110000];
  int x, y;
  for (int i = 0; i < n; ++i) cin >> a[i];
  cin >> x >> y;
  ans[0] = 0;
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    if ((i == 0) || (a[i] != a[i - 1])) {
      int st = y / a[i];
      st *= a[i];
      while (st <= x) {
        if (st - a[i] >= y) {
          if (ans[st - 1 - y] < a[i] - 1) ans[st - 1 - y] = a[i] - 1;
        }
        st += a[i];
      }
    }
  }
  ans[x - y] = 1;
  for (int i = 0; i < n; ++i) {
    if (ans[x - y] < x % a[i])
      if (x % a[i] <= x - y) ans[x - y] = x % a[i];
  }
  for (int i = 1; i <= x - y; ++i)
    if (ans[i] < 1) ans[i] = 1;
  for (int i = x - y - 1; i > 1; i--) {
    if (ans[i] < ans[i + 1] - 1) ans[i] = ans[i + 1] - 1;
  }
  int pp = 0;
  int cur = x - y;
  while (cur > 0) {
    ++pp;
    cur -= ans[cur];
  }
  cout << pp << endl;
  return 0;
}
