ceil = lambda a, b: (a + b - 1) // b def solve(D, X, Y): if X == Y == 0: return 0 res = ceil(max(X, Y), max(D)) if res == 1: res = 1 if max(X, Y) in D else 2 return res N = int(input()) D = set(map(int, input().split())) X, Y = map(int, input().split()) print(solve(D, X, Y))