#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double eps = 1e-12;
const int inf = 200000000;
const long long int infLL = 2e18;
long long int MOD = 1000000007;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
inline bool checkBit(long long int n, long long int i) {
  return n & (1LL << i);
}
inline long long int setBit(long long int n, long long int i) {
  return n | (1LL << i);
  ;
}
inline long long int resetBit(long long int n, long long int i) {
  return n & (~(1LL << i));
}
void yes() { cout << "YES" << '\n'; }
void no() { cout << "NO" << '\n'; }
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long int year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline void normal(long long int &a) {
  a %= MOD;
  (a < 0) && (a += MOD);
}
inline long long int modMul(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a * b) % MOD;
}
inline long long int modAdd(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a + b) % MOD;
}
inline long long int modSub(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline long long int modPow(long long int b, long long int p) {
  long long int r = 1LL;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1LL;
  }
  return r;
}
inline long long int modDiv(long long int a, long long int b) {
  return modMul(a, modPow(b, MOD - 2));
}
const int MAX = 100005;
long long int n, a, b;
set<long long int> store;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int i;
  cin >> n;
  for (i = 1; i <= n; ++i) {
    long long int ff;
    cin >> ff;
    store.insert(ff);
  }
  cin >> a >> b;
  long long int ans = 0;
  while (a > b) {
    long long int maxi = 1LL;
    vector<long long int> temp;
    for (auto it : store) {
      long long int cur = a % it;
      if (a - (cur) < b)
        temp.push_back(it);
      else {
        maxi = max(cur, maxi);
      }
    }
    for (i = 0; i < (int)temp.size(); ++i) store.erase(temp[i]);
    a -= maxi;
    ++ans;
  }
  cout << ans << '\n';
  return 0;
}
