import java.util.Arrays;
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[] x = {A, B, C};
		Arrays.sort(x);
		
		for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		}
		
		System.out.println(x[0] + x[1] + x[2]);
		
	}
} import java.util.Arrays; Arrays java.util 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[] x = {A, B, C};
		Arrays.sort(x);
		
		for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		}
		
		System.out.println(x[0] + x[1] + x[2]);
		
	}
} 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[] x = {A, B, C};
		Arrays.sort(x);
		
		for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		}
		
		System.out.println(x[0] + x[1] + x[2]);
		
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();
		
		int[] x = {A, B, C};
		Arrays.sort(x);
		
		for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		}
		
		System.out.println(x[0] + x[1] + x[2]);
		
	} 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[] x = {A, B, C}; x {A, B, C} A B C Arrays.sort(x) Arrays.sort Arrays x for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		} int i = 1; int i = 1; i 1 i <= K i K i++ i++ i {
			x[2] *= 2;
		} {
			x[2] *= 2;
		} x[2] *= 2 x[2] x 2 2 System.out.println(x[0] + x[1] + x[2]) System.out.println System.out System System.out x[0] + x[1] + x[2] x[0] + x[1] + x[2] x[0] x 0 x[1] x 1 x[2] x 2 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[] x = {A, B, C};
		Arrays.sort(x);
		
		for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		}
		
		System.out.println(x[0] + x[1] + x[2]);
		
	}
} 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[] x = {A, B, C};
		Arrays.sort(x);
		
		for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		}
		
		System.out.println(x[0] + x[1] + x[2]);
		
	}
} Main
import java.util.Arrays;
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[] x = {A, B, C};
		Arrays.sort(x);
		
		for(int i = 1; i <= K; i++) {
			x[2] *= 2;
		}
		
		System.out.println(x[0] + x[1] + x[2]);
		
	}
}
