import java.util.Arrays;
import java.util.Scanner;

class Main{



	public static void main(String[] args) {



		Scanner sc = new Scanner(System.in);			//文字の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();


		int ans = 0;
		int[] data = {a,b,c};	
		
		Arrays.sort(data);
		for(int i = 0;i < k;i++){
			data[2] *= 2;
		}
		System.out.println(data[2]+data[1]+data[0]);


	}






}




class Pair implements Comparable{
	String from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}


 import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main{



	public static void main(String[] args) {



		Scanner sc = new Scanner(System.in);			//文字の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();


		int ans = 0;
		int[] data = {a,b,c};	
		
		Arrays.sort(data);
		for(int i = 0;i < k;i++){
			data[2] *= 2;
		}
		System.out.println(data[2]+data[1]+data[0]);


	}






} Main public static void main(String[] args) {



		Scanner sc = new Scanner(System.in);			//文字の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();


		int ans = 0;
		int[] data = {a,b,c};	
		
		Arrays.sort(data);
		for(int i = 0;i < k;i++){
			data[2] *= 2;
		}
		System.out.println(data[2]+data[1]+data[0]);


	} main {



		Scanner sc = new Scanner(System.in);			//文字の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();


		int ans = 0;
		int[] data = {a,b,c};	
		
		Arrays.sort(data);
		for(int i = 0;i < k;i++){
			data[2] *= 2;
		}
		System.out.println(data[2]+data[1]+data[0]);


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int[] data = {a,b,c}; data {a,b,c} a b c Arrays.sort(data) Arrays.sort Arrays data for(int i = 0;i < k;i++){
			data[2] *= 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			data[2] *= 2;
		} {
			data[2] *= 2;
		} data[2] *= 2 data[2] data 2 2 System.out.println(data[2]+data[1]+data[0]) System.out.println System.out System System.out data[2]+data[1]+data[0] data[2]+data[1]+data[0] data[2] data 2 data[1] data 1 data[0] data 0 String[] args args class Pair implements Comparable{
	String from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
} Pair String from; from int end; end @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} compareTo {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return end - otherpair.end; end - otherpair.end end otherpair.end otherpair otherpair.end Object other other Comparable
import java.util.Arrays;
import java.util.Scanner;

class Main{



	public static void main(String[] args) {



		Scanner sc = new Scanner(System.in);			//文字の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();


		int ans = 0;
		int[] data = {a,b,c};	
		
		Arrays.sort(data);
		for(int i = 0;i < k;i++){
			data[2] *= 2;
		}
		System.out.println(data[2]+data[1]+data[0]);


	}






}




class Pair implements Comparable{
	String from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}



