#include <bits/stdc++.h>
using namespace std;
set<int> s;
set<int>::iterator it;
int main() {
  int n, t, a, b;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t);
    s.insert(t);
  }
  scanf("%d%d", &a, &b);
  int ans = 0;
  while (a != b) {
    int mi = a - 1;
    for (it = s.begin(); it != s.end();) {
      int x = *it;
      it++;
      if (a - a % x < b)
        s.erase(x);
      else
        mi = min(mi, a - a % x);
    }
    ans++;
    a = mi;
  }
  printf("%d\n", ans);
  return 0;
}
