import java.util.Scanner;

public 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[] array = {a, b, c};
		int max = 0;
		for (int i : array) {
			if (max < i) {
				max = i;
			}
		}
		int answer = 0;
		int x = (int) Math.pow(2, K) * max;
		boolean twice = false;
		for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		}
		System.out.println(answer);
	}
} import java.util.Scanner; Scanner java.util public 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[] array = {a, b, c};
		int max = 0;
		for (int i : array) {
			if (max < i) {
				max = i;
			}
		}
		int answer = 0;
		int x = (int) Math.pow(2, K) * max;
		boolean twice = false;
		for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		}
		System.out.println(answer);
	}
} 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[] array = {a, b, c};
		int max = 0;
		for (int i : array) {
			if (max < i) {
				max = i;
			}
		}
		int answer = 0;
		int x = (int) Math.pow(2, K) * max;
		boolean twice = false;
		for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		}
		System.out.println(answer);
	} main {
		
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int K = sc.nextInt();
		
		int[] array = {a, b, c};
		int max = 0;
		for (int i : array) {
			if (max < i) {
				max = i;
			}
		}
		int answer = 0;
		int x = (int) Math.pow(2, K) * max;
		boolean twice = false;
		for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		}
		System.out.println(answer);
	} 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[] array = {a, b, c}; array {a, b, c} a b c int max = 0; max 0 for (int i : array) {
			if (max < i) {
				max = i;
			}
		} int i array {
			if (max < i) {
				max = i;
			}
		} {
			if (max < i) {
				max = i;
			}
		} if (max < i) {
				max = i;
			} max < i max i {
				max = i;
			} max = i max i int answer = 0; answer 0 int x = (int) Math.pow(2, K) * max; x (int) Math.pow(2, K) * max (int) Math.pow(2, K) Math.pow Math 2 K max boolean twice = false; twice false for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		} int j array {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		} {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		} if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			} max == j && !twice max == j max j !twice twice {
				answer += x;
				twice = true;
			} answer += x answer x twice = true twice true {
				answer += j;
			} answer += j answer j System.out.println(answer) System.out.println System.out System System.out answer String[] args args public 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[] array = {a, b, c};
		int max = 0;
		for (int i : array) {
			if (max < i) {
				max = i;
			}
		}
		int answer = 0;
		int x = (int) Math.pow(2, K) * max;
		boolean twice = false;
		for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		}
		System.out.println(answer);
	}
} public 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[] array = {a, b, c};
		int max = 0;
		for (int i : array) {
			if (max < i) {
				max = i;
			}
		}
		int answer = 0;
		int x = (int) Math.pow(2, K) * max;
		boolean twice = false;
		for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		}
		System.out.println(answer);
	}
} Main
import java.util.Scanner;

public 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[] array = {a, b, c};
		int max = 0;
		for (int i : array) {
			if (max < i) {
				max = i;
			}
		}
		int answer = 0;
		int x = (int) Math.pow(2, K) * max;
		boolean twice = false;
		for (int j : array) {
			if (max == j && !twice) {
				answer += x;
				twice = true;
			} else {
				answer += j;
			}
		}
		System.out.println(answer);
	}
}