program kadai
implicit none
integer(8)  ::  n,m
integer(8),allocatable  ::  a(:)
integer(8)  ::  loc,i

read(*,*) n,m
allocate(a(n))
read(*,*) a

do i=1,m
    loc=maxloc(a,1)
    a(loc)=a(loc)/2
end do

write(*,*) sum(a)

stop
contains

end program kadai