#!/usr/local/gnu/bin/bash
read n k
read -a h
if((n<=k))
then
    echo 0
    exit
elif((k>0))
then
    h=(`echo ${h[@]} | tr ' ' '\n' | sort -n | head -$((n-k))`)
fi
sum=0
for i in `echo ${h[@]}`
do
    sum=$((sum+i))
done
echo $sum