def half1(a)
    if a%2==1
        return a/2+1
    else
        return a/2
    end
end

n,m=gets.split.map(&:to_i)
array=gets.split.map(&:to_i)


sum=0
array.map{|i| sum+=i}

array=array.sort.reverse

if n==1
    m.times{
        sum-=half1(array[0])
        array[0]-=half1(array[0])
    }
    p sum
    exit
end


m.times {
    
    sum-=half1(array[0])
    array[0]-=half1(array[0])
    halfnumber=array[0]
    array.shift
    index=(0...m-1).bsearch {|i| array[i] <= halfnumber}
    
    if index
        array.insert(index,halfnumber)
    else
        array.push(halfnumber)
    end
    
}

p sum