n, m = gets.split.map &:to_i
a = gets.split.map &:to_i
a.sort!
if a.size > 1
  while m > 0
    j = 1
    while (a[-1] / 2**j) >= a[-2]
      if j + 1 <= m
        j += 1
      else
        break
      end
    end
    if m - j >= 0
      a[-1] = a[-1] / (2**j)
      m -= j
    end
    a.sort!
  end
else
  a[0] /= (2**m)
end
puts a.inject(:+)