str = gets.split
N,m = str[0].to_i, str[1].to_i

a = Array.new(N)
str = gets.split
i = 0
while i < N
    a[i] = str[i].to_i
    i += 1
end
a.sort!

b = Array.new(0)
c = 1
d = 0
i = 0
while i < N
    if a[i] <= c
        d += 1
        i += 1
    else
        b.push(d)
        d = 0
        c *= 2
    end
end
b.push(d)
d = 0

while d <= m
    for i in 1..d do
        a[-i] /= 2
    end
    m -= d
    if b.empty?
       puts 0
       exit 
    else
        d += b.pop
    end
end
a.sort!

for i in 1..m do
    a[-i] /= 2
end

answer = 0
i = 0
while i < N
    answer += a[i]
    i += 1
end
puts answer