#include <bits/stdc++.h>
using namespace std;
int n, s[100005];
int nex(int a, int b) { return a - (a % b); }
int main() {
  int a, b;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &s[i]);
  scanf("%d%d", &a, &b);
  sort(s, s + n);
  vector<int> v[2];
  int k = 0;
  for (int i = 0; i < n; i++)
    if (i == 0 || s[i] != s[i - 1]) v[k].push_back(s[i]);
  int step = 0;
  while (a != b) {
    int next = a - 1;
    v[1 - k].clear();
    for (int i = 0; i < v[k].size(); i++) {
      int temp = nex(a, v[k][i]);
      if (temp >= b) {
        next = min(next, temp);
        v[1 - k].push_back(v[k][i]);
      }
    }
    a = next, step++, k = 1 - k;
  }
  printf("%d\n", step);
  return 0;
}
