#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000009;
const int maxn = 100040;
int ta[maxn];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int num = 0;
    int a, b;
    for (int i = 0; i < n; i++) {
      scanf("%d", &ta[i]);
    }
    sort(ta, ta + n);
    n = unique(ta, ta + n) - ta;
    scanf("%d%d", &a, &b);
    while (a > b) {
      int cur = a - 1;
      for (int i = n - 1; i >= 0; i--) {
        if (a - a % ta[i] >= b) cur = min(a - a % ta[i], cur);
      }
      a = cur;
      num++;
      if (a == b) break;
      while (n) {
        if (a - a % ta[n - 1] < b)
          n--;
        else
          break;
      }
    }
    printf("%d\n", num);
  }
  return 0;
}
