#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long MAX = 1e17;
int n, c, b;
int a[100005];
int main() {
  ios_base::sync_with_stdio(0);
  ;
  cin >> n;
  int mini = INT_MAX;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  n = unique(a, a + n) - a;
  cin >> c >> b;
  c -= b;
  int ans = 0;
  while (c) {
    int x = c - 1;
    for (int i = 0; i < n; i++) {
      if ((c + b) % a[i] <= c)
        x = min(x, c - (c + b) % a[i]);
      else
        a[i--] = a[--n];
    }
    c = x;
    ans++;
  }
  cout << ans << endl;
}
