read n m k
read -a a
read -a b
c=0
a+=(999999999999)
b+=(999999999999)
ai=0
bi=0
while :
do
    if((a[ai]<b[bi]))
    then
        v=${a[ai]}
        ai=$((ai+1))
    else
        v=${b[bi]}
        bi=$((bi+1))
    fi
    if((k<v))
    then
        break
    else
        k=$((k-v))
        c=$((c+1))
    fi
done
echo $c
