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