#include <bits/stdc++.h>
using namespace std;
map<int, int> occur;
const int N = 100010;
int d[N];
int main() {
  int n, k;
  cin >> n;
  set<int> x;
  int temp, a, b;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    d[i] = temp;
  }
  cin >> a >> b;
  sort(d, d + n);
  k = unique(d, d + n) - d;
  int ans = 0;
  while (a != b) {
    int dif = a - b;
    int res = a - 1;
    for (int i = 0; i < k; i++) {
      int t = d[i];
      int temp = a - a % t;
      ;
      if (temp >= b)
        res = min(res, temp);
      else {
        swap(d[i], d[k - 1]);
        k--;
        i--;
      }
    }
    a = res;
    ans++;
  }
  cout << ans;
  return 0;
}
