read n
read a b
read -a p
c0=0
c1=0
c2=0
for x in ${p[@]}
do
    if((x<=a))
    then
        c0=$((c0+1))
    elif((x<=b))
    then
        c1=$((c1+1))
    else
        c2=$((c2+1))
    fi
done
((c0<c1)) && echo $((c0<c2?c0:c2)) || echo $((c1<c2?c1:c2))
