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 biggestNum = 1;
		if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}
		}
	}

 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 biggestNum = 1;
		if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}
		}
	} 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 biggestNum = 1;
		if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}
		} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int K = sc.nextInt();
		int biggestNum = 1;
		if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}
		} 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 biggestNum = 1; biggestNum 1 if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			} a >= b a b {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			} a >= c a c {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} biggestNum = a biggestNum a for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				} int i = 0 ; int i = 0 ; i 0 i < K i K i++ i++ i {
					biggestNum *=  2;
				} {
					biggestNum *=  2;
				} biggestNum *=  2 biggestNum 2 System.out.println(biggestNum + b + c) System.out.println System.out System System.out biggestNum + b + c biggestNum + b + c biggestNum b c {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			} biggestNum = c biggestNum c for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				} int i = 0 ; int i = 0 ; i 0 i < K i K i++ i++ i {
					biggestNum *=  2;
				} {
					biggestNum *=  2;
				} biggestNum *=  2 biggestNum 2 System.out.println(biggestNum + a + b) System.out.println System.out System System.out biggestNum + a + b biggestNum + a + b biggestNum a b if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			} b >= c b c {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} biggestNum = b biggestNum b for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				} int i = 0 ; int i = 0 ; i 0 i < K i K i++ i++ i {
					biggestNum *=  2;
				} {
					biggestNum *=  2;
				} biggestNum *=  2 biggestNum 2 System.out.println(biggestNum + a + c) System.out.println System.out System System.out biggestNum + a + c biggestNum + a + c biggestNum a c {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			} biggestNum = c biggestNum c for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				} int i = 0 ; int i = 0 ; i 0 i < K i K i++ i++ i {
					biggestNum *=  2;
				} {
					biggestNum *=  2;
				} biggestNum *=  2 biggestNum 2 System.out.println(biggestNum + a + b) System.out.println System.out System System.out biggestNum + a + b biggestNum + a + b biggestNum a b 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 biggestNum = 1;
		if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}
		}
	} 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 biggestNum = 1;
		if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}
		}
	} 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 biggestNum = 1;
		if (a >= b) {
			if (a >= c) {
				biggestNum = a;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + b + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}} else if (b >= c) {
				biggestNum = b;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + c);
			} else {
				biggestNum = c;
				for (int i = 0 ; i < K ; i++) {
					biggestNum *=  2;
				}
				System.out.println(biggestNum + a + b);
			}
		}
	}


