n = int(input()) *d, = map(int,input().split()) x,y = map(int,input().split()) z = max(abs(x),abs(y)) d0 = max(d) if z > d0: print((z+d0-1)//d0) elif x==y==0: print(0) else: if max(abs(x),abs(y)) in d: print(1) else: print(2)