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

class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int K = scanner.nextInt();

		//A,B,Cを昇順に並び替える
		int[] array = {A, B, C};
		Arrays.sort(array);

		/*
		for (int i : array) {
		    System.out.println(i);
		}
		*/

		//最大値をK回2倍し、他の2つの数を足す
		int add = array[2];
		for (int i = 0; i < K; i++) {
		    add *= 2;
		}
		System.out.println(add + array[0] + array[1]);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int K = scanner.nextInt();

		//A,B,Cを昇順に並び替える
		int[] array = {A, B, C};
		Arrays.sort(array);

		/*
		for (int i : array) {
		    System.out.println(i);
		}
		*/

		//最大値をK回2倍し、他の2つの数を足す
		int add = array[2];
		for (int i = 0; i < K; i++) {
		    add *= 2;
		}
		System.out.println(add + array[0] + array[1]);
	}
} Main public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int K = scanner.nextInt();

		//A,B,Cを昇順に並び替える
		int[] array = {A, B, C};
		Arrays.sort(array);

		/*
		for (int i : array) {
		    System.out.println(i);
		}
		*/

		//最大値をK回2倍し、他の2つの数を足す
		int add = array[2];
		for (int i = 0; i < K; i++) {
		    add *= 2;
		}
		System.out.println(add + array[0] + array[1]);
	} main {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int K = scanner.nextInt();

		//A,B,Cを昇順に並び替える
		int[] array = {A, B, C};
		Arrays.sort(array);

		/*
		for (int i : array) {
		    System.out.println(i);
		}
		*/

		//最大値をK回2倍し、他の2つの数を足す
		int add = array[2];
		for (int i = 0; i < K; i++) {
		    add *= 2;
		}
		System.out.println(add + array[0] + array[1]);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int A = scanner.nextInt(); A scanner.nextInt() scanner.nextInt scanner int B = scanner.nextInt(); B scanner.nextInt() scanner.nextInt scanner int C = scanner.nextInt(); C scanner.nextInt() scanner.nextInt scanner int K = scanner.nextInt(); K scanner.nextInt() scanner.nextInt scanner int[] array = {A, B, C}; array {A, B, C} A B C Arrays.sort(array) Arrays.sort Arrays array int add = array[2]; add array[2] array 2 for (int i = 0; i < K; i++) {
		    add *= 2;
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
		    add *= 2;
		} {
		    add *= 2;
		} add *= 2 add 2 System.out.println(add + array[0] + array[1]) System.out.println System.out System System.out add + array[0] + array[1] add + array[0] + array[1] add array[0] array 0 array[1] array 1 String[] args args
import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int B = scanner.nextInt();
		int C = scanner.nextInt();
		int K = scanner.nextInt();

		//A,B,Cを昇順に並び替える
		int[] array = {A, B, C};
		Arrays.sort(array);

		/*
		for (int i : array) {
		    System.out.println(i);
		}
		*/

		//最大値をK回2倍し、他の2つの数を足す
		int add = array[2];
		for (int i = 0; i < K; i++) {
		    add *= 2;
		}
		System.out.println(add + array[0] + array[1]);
	}
}