#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int n, a, b, ans;
vector<int> vx, v;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    vx.push_back(x);
  }
  cin >> a >> b;
  sort(vx.begin(), vx.end());
  vx.resize(unique(vx.begin(), vx.end()) - vx.begin());
  while (a != b) {
    v.clear();
    int mn = a - 1;
    for (int i : vx) {
      int t = a / i * i;
      if (t >= b) {
        mn = min(mn, t);
        v.push_back(i);
      }
    }
    a = mn;
    vx = v;
    ans++;
  }
  cout << ans << endl;
}
