program abc63
 implicit none
 integer(8)::N,K,ia,ib,ic,id,swap,c=0
 integer(8),allocatable::H(:)
 read(*,*)N,K
 allocate(H(N))
 read(*,*)(H(ia),ia=1,N)
 do ib=1,N-1
  do ic=1,N-ib
   if(H(ic)<H(ic+1))then
    swap=H(ic)
    H(ic)=H(ic+1)
    H(ic+1)=swap
   end if
  end do
 end do
 print'(i0)',sum(H(K+1:N))
 deallocate(H)
end program abc63