O=print J=lambda:map(int,input().split()) N,*_=J() A,B=J() i=0 for p in J(): A-=p&1;B-=p>1;i+=1 if A<0 or B<0:exit(O(i)) else:O(-1)