#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int d[N];
int a, b, n;
template <class T>
void checkMin(T& r, T v) {
  if (r > v) r = v;
}
int dp[10 * N];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", d + i);
  scanf("%d%d", &a, &b);
  sort(d, d + n);
  n = unique(d, d + n) - d;
  int ans = 0;
  while (1) {
    if (a == b) break;
    int step = 1;
    for (int i = 0; i < n; ++i) {
      int temp = a % d[i];
      if (a - temp >= b)
        step = max(step, temp);
      else {
        swap(d[i], d[n - 1]);
        n--;
        i--;
      }
    }
    a -= step;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
