#include <bits/stdc++.h>
using namespace std;
int n, ans, a, b, v[100007];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  sort(v, v + n);
  n = unique(v, v + n) - v;
  scanf("%d%d", &a, &b);
  while (a != b) {
    int k = a - 1;
    for (int i = 0; i < n; i++) {
      int j = a - a % v[i];
      if (j < b)
        v[i--] = v[--n];
      else
        k = min(k, j);
    }
    a = k, ans++;
  }
  printf("%d", ans);
}
