import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmpArray = br.readLine().split(" ");
		
		int input[] = new int[3];
		input[0] = Integer.parseInt(tmpArray[0]);
		input[1] = Integer.parseInt(tmpArray[1]);
		input[2] = Integer.parseInt(tmpArray[2]);
		
		Arrays.sort(input);
		
		int k = Integer.parseInt(br.readLine());
		int result = 0;

		for(int i = 0; i < k; i++){
			input[2] *= 2;
		}
		
		for(int i = 0; i < 3; i++){
			result += input[i];
		}
		System.out.println(result);
	}

}

/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