#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
set<int> S;
int n, a, b;
int main() {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; i++) scanf("%d", &x), S.insert(x);
  scanf("%d%d", &a, &b);
  int tim = 0;
  while (a != b) {
    int mn = a - 1;
    for (set<int>::iterator it = S.begin(); it != S.end();) {
      int x = *it;
      it++;
      if (a - a % x < b)
        S.erase(x);
      else
        mn = min(mn, a - a % x);
    }
    a = mn;
    tim++;
  }
  printf("%d", tim);
}
