import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args){
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz