import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int max;
		if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		}
		if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		}
		System.out.println(max);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int max;
		if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		}
		if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		}
		System.out.println(max);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int max;
		if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		}
		if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		}
		System.out.println(max);
	} main {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int max;
		if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		}
		if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		}
		System.out.println(max);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan int C = scan.nextInt(); C scan.nextInt() scan.nextInt scan int K = scan.nextInt(); K scan.nextInt() scan.nextInt scan int max; max if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		} A <= B A B {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		} if(B <= C) {
				max = C;
			}else {
				max = B;
			} B <= C B C {
				max = C;
			} max = C max C {
				max = B;
			} max = B max B {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		} if(A <= C) {
				max = C;
			}else {
				max = A;
			} A <= C A C {
				max = C;
			} max = C max C {
				max = A;
			} max = A max A if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		} max == A max A {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		} for(int i = 0;i < K;i++) {
				max *= 2;
			} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
				max *= 2;
			} {
				max *= 2;
			} max *= 2 max 2 max = max + B + C max max + B + C max + B + C max B C if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		} max == B max B {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		} for(int i = 0;i < K;i++) {
				max *= 2;
			} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
				max *= 2;
			} {
				max *= 2;
			} max *= 2 max 2 max = max + A + C max max + A + C max + A + C max A C {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		} for(int i = 0;i < K;i++) {
				max *= 2;
			} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
				max *= 2;
			} {
				max *= 2;
			} max *= 2 max 2 max = max + B + A max max + B + A max + B + A max B A System.out.println(max) System.out.println System.out System System.out max String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int max;
		if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		}
		if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		}
		System.out.println(max);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int max;
		if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		}
		if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		}
		System.out.println(max);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int max;
		if(A <= B) {
			if(B <= C) {
				max = C;
			}else {
				max = B;
			}
		}else {
			if(A <= C) {
				max = C;
			}else {
				max = A;
			}
		}
		if(max == A) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + C;
		}else if(max == B) {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + A + C;
		}else {
			for(int i = 0;i < K;i++) {
				max *= 2;
			}
			max = max + B + A;
		}
		System.out.println(max);
	}
}