import java.util.*;


public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		}
	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

} import java.util.*; util.* java public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		}
	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

} Main private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		}
	} doit {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		} sc.hasNext() sc.hasNext sc {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		} 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 max = Math.max(a, Math.max(b, c)); max Math.max(a, Math.max(b, c)) Math.max Math a Math.max(b, c) Math.max Math b c int sum = max; sum max for(int i = 0; i < k; i++){
				sum *= 2;
			} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
				sum *= 2;
			} {
				sum *= 2;
			} sum *= 2 sum 2 System.out.println(a + b + c + sum - max) System.out.println System.out System System.out a + b + c + sum - max a + b + c + sum c a + b + c + sum a b c sum max private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	} debug {
		System.out.println("debug = " + Arrays.deepToString(o));
	} System.out.println("debug = " + Arrays.deepToString(o)) System.out.println System.out System System.out "debug = " + Arrays.deepToString(o) "debug = " Arrays.deepToString(o) Arrays.deepToString Arrays o Object... o o public static void main(String[] args) {
		new Main().doit();
	} main {
		new Main().doit();
	} new Main().doit() new Main().doit new Main() String[] args args public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		}
	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

} public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		}
	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

} Main
import java.util.*;


public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Math.max(a, Math.max(b, c));
			int sum = max;
			for(int i = 0; i < k; i++){
				sum *= 2;
			}
			System.out.println(a + b + c + sum - max);
			
		}
	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

}
