from bisect import bisect,bisect_left n,l,r=map(int,input().split()) A=list(map(int,input().split())) PLUS=[] MINUS=[] zero=0 for a in A: if a>0: PLUS.append(a) elif a<0: MINUS.append(a) else: zero+=1 PLUS.sort() MINUS.sort() def check(x,y,A): for i in range(x+1,x+3): if x<=i<=y: if x!=i: if l<=A[x]*A[i]<=r: pass else: return False if y!=i: if l<=A[y]*A[i]<=r: pass else: return False for i in range(y-2,y): if x<=i<=y: if x!=i: if l<=A[x]*A[i]<=r: pass else: return False if y!=i: if l<=A[y]*A[i]<=r: pass else: return False return True ANS=0 for i in range(len(PLUS)): for ind in range(i,len(PLUS)): if check(i,ind,PLUS)==False: break k0=PLUS[i] k1=PLUS[ind] if l>=0: MIN=max(l//k0,l//k1) else: MIN=max((l+k0-1)//k0,(l+k1-1)//k1) if r>=0: MAX=min(r//k0,r//k1) else: MAX=min((r+k0-1)//k0,(r+k1-1)//k1) plus=0 if MIN<=MAX: x0=bisect_left(MINUS,MIN) x1=bisect(MINUS,MAX) plus=x1-x0 #print(i,ind,MIN,MAX,plus) ANS=max(ANS,ind-i+1+plus) for i in range(len(MINUS)): for ind in range(i,len(MINUS)): if check(i,ind,MINUS)==False: break k0=MINUS[i] k1=MINUS[ind] if l>=0: MAX=min(l//k0,l//k1) else: MAX=min((l+k0-1)//k0,(l+k1-1)//k1) if r>=0: MIN=max(r//k0,r//k1) else: MIN=max((r+k0-1)//k0,(r+k1-1)//k1) plus=0 if MIN<=MAX: x0=bisect_left(PLUS,MIN) x1=bisect(PLUS,MAX) plus=x1-x0 #print(i,ind,MIN,MAX,plus) ANS=max(ANS,ind-i+1+plus) print(ANS)