program test
implicit none
  real,allocatable::a(:)
  integer :: N,M,o,l,j,ans,i
  read*,N,M
  allocate(a(N))
  read(*,*)(a(i),i=1,N)
  o=0
  l=0
  do i=1,M
  	o=maxval(a)
  	do j=1,N
    	if(a(j)==o) then
        	l=j 
        	exit
        end if
    end do
    	a(l)=aint(a(l)/2)
  end do
  do i=1,N
  ans=ans+a(i)
  end do
  print*,ans
end program test