N = int(input())
D = list(map(int, input().split()))
Dmax = max(D)

x, y = map(int, input().split())
x = abs(x)
y = abs(y)
if x > y:
    x, y = y, x

if y == 0:
    print(0)
elif y >= Dmax:
    print((y + Dmax - 1) // Dmax)
elif y in D:
    print(1)
else:
    print(2)