
n,m = gets.chomp.split.collect{ |item| item.to_i}
alist = gets.chomp.split.collect{ |item| item.to_i}

alist = alist.sort.reverse
blist = []
blist.push(alist.shift/2)

(m-1).times do
  if alist == []
    alist = blist
    blist = []
    blist.push(alist.shift/2)
  elsif alist[0] >= blist[0]
    blist.push(alist.shift/2)
  else
    blist.push(blist.shift/2)
  end
end

alist.push(0)
blist.push(0)
ans = alist.inject(:+) + blist.inject(:+)

puts ans