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