import Foundation
import CoreFoundation

#if swift(>=4.0)
prefix operator *
infix operator **: PowerPrecedence
precedencegroup PowerPrecedence {
    higherThan: MultiplicationPrecedence
    lowerThan: BitwiseShiftPrecedence
    associativity: right
}
struct Stack<Element>: Collection {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    func index(after index: Int) -> Int {
        return items.index(after: index)
    }
    mutating func push(_ item: Element) {
        items.append(item)
    }
    mutating func pop() -> Element {
        return items.removeLast()
    }
}
struct Queue<Element>: Collection {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    func index(after index: Int) -> Int {
        return items.index(after: index)
    }
    mutating func push(_ item: Element) {
        items.append(item)
    }
    mutating func pop() -> Element {
        return items.removeFirst()
    }
}
struct Heap<Element: Comparable>: Collection {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    func index(after index: Int) -> Int {
        return items.index(after: index)
    }
    mutating func push(_ item: Element) {
        var i = items.count
        while i > 0 {
            let p = (i - 1) / 2
            if items[p] <= item {
                break
            }
            if i == items.count {
                items.append(items[p])
            } else {
                items[i] = items[p]
            }
            i = p
        }
        if i == items.count {
            items.append(item)
        } else {
            items[i] = item
        }
    }
    mutating func pop() -> Element {
        let ret = items[0]
        let x = items[items.count - 1]
        var i: Int = 0
        while i * 2 + 1 < items.count - 1 {
            var a = i * 2 + 1
            let b = i * 2 + 2
            if b < items.count - 1 && items[b] < items[a] {
                a = b
            }
            if items[a] >= x {
                break
            }
            items[i] = items[a]
            i = a
        }
        items[i] = x
        _ = items.removeLast()
        return ret
    }
}
#else
prefix operator * { }
infix operator ** {
    precedence 155      // 乗除算より強く，ビットシフトより弱い
    associativity right // 右結合
}
struct Stack<Element>: CollectionType {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    mutating func push(item: Element) {
        items.append(item)
    }
    mutating func pop() -> Element {
        return items.removeLast()
    }
}
struct Queue<Element>: CollectionType {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    mutating func push(item: Element) {
        items.append(item)
    }
    mutating func pop() -> Element {
        return items.removeFirst()
    }
}
struct Heap<Element: Comparable>: CollectionType {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    mutating func push(item: Element) {
        var i = items.count
        while i > 0 {
            let p = (i - 1) / 2
            if items[p] <= item {
                break
            }
            if i == items.count {
                items.append(items[p])
            } else {
                items[i] = items[p]
            }
            i = p
        }
        if i == items.count {
            items.append(item)
        } else {
            items[i] = item
        }
    }
    mutating func pop() -> Element {
        let ret = items[0]
        let x = items[items.count - 1]
        var i: Int = 0
        while i * 2 + 1 < items.count - 1 {
            var a = i * 2 + 1
            let b = i * 2 + 2
            if b < items.count - 1 && items[b] < items[a] {
                a = b
            }
            if items[a] >= x {
                break
            }
            items[i] = items[a]
            i = a
        }
        items[i] = x
        _ = items.removeLast()
        return ret
    }
}
extension Character {
    func uppercased() -> Character {
        return Character(String(self).uppercaseString)
    }
    func lowercased() -> Character {
        return Character(String(self).lowercaseString)
    }
}
extension String: CollectionType {
    func split(separator separator: Character) -> [String] {
        return self.split(separator)
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
    func reversed() -> ReverseCollection<String> {
        return self.reverse()
    }
    func map<T>(transform: (Character) -> T) -> [T] {
        return self.characters.map{transform($0)}
    }
    func filter(isIncluded: (Character) -> Bool) -> String {
        return String(self.filter{isIncluded($0)})
    }
    func enumerated() -> EnumerateSequence<String> {
        return self.enumerate()
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted(by areInIncreasingOrder: (Element, Element) -> Bool = {$0 < $1}) -> [Element] {
        return self.sort(areInIncreasingOrder)
    }
    mutating func sort(by areInIncreasingOrder: (Element, Element) -> Bool = {$0 < $1}) {
        self.sortInPlace(areInIncreasingOrder)
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
extension _ArrayType where Generator.Element == String {
    func joined(separator separator: String = "") -> String {
        return self.joinWithSeparator(separator)
    }
}
extension Range {
    func reversed() -> [Element] {
        return self.reverse()
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
prefix func * <T> (a: [T]) -> (T, T)             { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)          { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)       { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T)    { return (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4], a[5]) }
func **(lhs: Int, rhs: Int) -> Int {
    return Int(pow(Double(lhs), Double(rhs)))
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
func * <Element> (lhs: [Element], rhs: Int) -> [Element] {
    return (0..<rhs).flatMap{_ in lhs}
}
func *(lhs: String, rhs: Int) -> String {
    return (0..<rhs).reduce(""){s,_ in s+lhs}
}
let MOD = 10 ** 9 + 7
let alphabets = "abcdefghijklmnopqrstuvwxyz"
let ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
extension Array where Element: Equatable {
    func count(of value: Element) -> Int {
        return self.reduce(0){$0+($1==value ? 1 : 0)}
    }
}
extension String {
    func count(of value: Character) -> Int {
        return self.reduce(0){$0+($1==value ? 1 : 0)}
    }
    subscript(i: Int) -> Character {
        return self.map{$0}[i]
    }
}
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringsSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator).map{String($0)}
}
func readIntsSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
func gcd(x: Int, _ y: Int) -> Int {
    return y>0 ? gcd(y, x%y) : x
}
func lcm(x: Int, _ y: Int) -> Int {
    return x * y / gcd(x, y)
}
func manhattanDistance(x1: Int, _ y1: Int, _ x2: Int, _ y2: Int) -> Int {
    return abs(x1 - x2) + abs(y1 - y2)
}
func euclideanDistance(x1: Int, _ y1: Int, _ x2: Int, _ y2: Int) -> Double {
    return sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
}

/*************** メインプログラム ***************/

let (N, M) = *readIntsSplit()
var q = Heap<Int>()
readIntsSplit().forEach{q.push(-$0)}
(0..<M).forEach{_ in q.push(q.pop()/2)}
print(q.reduce(0){$0-$1})


Measured memory_bytes: 8144