#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
vector<int> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  int a, b;
  cin >> a >> b;
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  n = v.size();
  int cnt = 0;
  while (a > b) {
    int mn = 2e9;
    for (int i = 0; i < n; i++) {
      int num = a - a % v[i];
      if (num >= b) mn = min(num, mn);
    }
    while (v.back() > a) v.pop_back();
    n = v.size();
    if (mn == 2e9) {
      cnt += a - b;
      break;
    }
    if (mn == 2e9 or a == mn)
      a--;
    else
      a = mn;
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
