let [|n;m|]=stdin.ReadLine().Split() |> Array.map int
let mutable a=stdin.ReadLine().Split() |> Array.map int64
let rec g i j =
    if i=n then j
    elif a.[i]>a.[j] then g (i+1) i
    else g (i+1) j
let rec f i :int64 =
    if i=m then (a |> Array.sum)
    else
        g 0 0 |> fun x -> a.[x] <- (a.[x]/2L)
        f (i+1)
f 0 |> stdout.WriteLine