open System
open System.Collections.Generic

let ReadOne T = stdin.ReadLine()|> T
let ReadSplit T = stdin.ReadLine().Split()|>Array.map T
[<EntryPoint>]
let main argv =
    let a,b,c=stdin.ReadLine().Split()|>fun p -> int p.[0],int p.[1],int p.[2]
    let K=ReadOne int
    let rec fn x num = if num=K then x else fn (x*2) (num+1)
    let m =max (max a b) c
    (a+b+c)-m+(fn m 0)
    |>stdout.WriteLine
    0
