open System

// prelude
let readStr () = stdin.ReadLine()

let reads f () = readStr().Split() |> Array.map f

let readInt () = stdin.ReadLine() |> int
let readInts () = stdin.ReadLine().Split() |> Array.map int

let pair = function
| [|a; b|] -> (a, b)
| _ -> failwith "owatta"

let triple = function
| [|a; b; c|] -> (a, b, c)
| _ -> failwith "owatta"

let inc n = n + 1
let dec n = n - 1

let inline flip f a b = f b a
let rec fix f = fun x -> (f (fix f)) x

module Option =
  let getOr defaultValue = function
  | Some x -> x
  | None -> defaultValue

module Array =
  let modify (arr: _ []) i f =
    arr.[i] <- f arr.[i]

module Array2D =
  let modify (arr: _ [,]) i j f =
    arr.[i, j] <- f arr.[i, j]

// Binominal Heap
type Tree<'a when 'a: comparison> = Node of int * 'a * Tree<'a> list
type Heap<'a when 'a: comparison> = Heap of Tree<'a> list

[<RequireQualifiedAccess>]
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
module Heap =
  let empty = Heap []
  let singleton x = Heap [Node(0, x, [])]
 
  let isEmpty = function
    | Heap [] -> true
    | _ -> false
  let private rank (Node(r,_,_)) = r
  let private root (Node(_,x,_)) = x
  let private link (Node(r,x1,c1) as t1) (Node(_,x2,c2) as t2) =
    if x1>=x2 then Node(r+1, x1, t2::c1) else Node(r+1, x2, t1::c2)

  let private insTree t h =
    let rec go t h =
      match h with
      | [] -> [t]
      | t1::hs ->
        if rank t < rank t1 then t::h else go (link t t1) hs
    go t h

  let merge (Heap h1) (Heap h2) =
    let rec go h1 h2 =
      match (h1, h2) with
      | (_, []) -> h1
      | ([], _) -> h2
      | (t1::h1s, t2::h2s) ->
        let r1 = rank t1
        let r2 = rank t2
        if r1<r2 then t1::(go h1s h2)
        elif r2>r1 then t2::(go h1 h2s)
        else insTree (link t1 t2) (go h1s h2s)
    Heap(go h1 h2)
  
  let insert x (Heap h) = Heap(insTree (Node(0, x, [])) h)

  let private uncons h =
    let rec go = function
      | [] -> failwith "empty"
      | [t] -> (t, [])
      | t::ts ->
        let (t', ts') = go ts
        if root t>=root t' then (t, ts) else (t', t::ts')
    go h
  
  let head (Heap h) = uncons h |> fst |> root
  let tail (Heap h) =
    let (Node(_,x,c), hs) = uncons h
    merge (Heap(List.rev c)) (Heap hs)

  let (|Cons|Nil|) (Heap h) =
    if List.isEmpty h then Nil
    else
      let (Node(_,x,c), hs) = uncons h
      Cons(x, (merge (Heap(List.rev c)) (Heap hs)))


// start
let (N,M)=readInts()|>pair
let A=reads int64 ()

let rec go m = function
  | Heap.Nil -> failwith "arienq"
  | Heap.Cons (x,h) ->
    if m>0 then
      go (m-1) (h|>Heap.insert (x/2L))
    else
      h|>Heap.insert x

let rec sum = function
  | Heap.Nil -> 0L
  | Heap.Cons(x,h) -> x+(sum h)

A
|> Array.fold (flip Heap.insert) Heap.empty
|> go M
|> sum
|> printfn "%d"