program test03
 integer N, K
 integer,allocatable :: H(:)
 integer :: saikyou(1)=0
 integer(8) :: kougeki=0
 integer i
 
 read *, N, K
 allocate(H(N))

 read *, H

 do i=1,K
  saikyou=maxloc(H)
  H(saikyou(1))=0
 end do

!do i=1,N
! kougeki=kougeki+H(i)
!end do

 print '(i0)',sum(H)

endprogram test03
