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 ans = 0;
		for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		}

		System.out.println(A + B + C);
	}
} 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 ans = 0;
		for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		}

		System.out.println(A + B + C);
	}
} 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 ans = 0;
		for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		}

		System.out.println(A + B + C);
	} main {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();

		int ans = 0;
		for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		}

		System.out.println(A + B + C);
	} 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 ans = 0; ans 0 for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		} {
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		} if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			} A > B A B {
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			} if (A > C){
					A *= 2;
				}else{
					C *= 2;
				} A > C A C {
					A *= 2;
				} A *= 2 A 2 {
					C *= 2;
				} C *= 2 C 2 {
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			} if (B > C){
					B *= 2;
				}else{
					C *= 2;
				} B > C B C {
					B *= 2;
				} B *= 2 B 2 {
					C *= 2;
				} C *= 2 C 2 System.out.println(A + B + C) System.out.println System.out System System.out A + B + C A + B + C A B C 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 ans = 0;
		for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		}

		System.out.println(A + B + C);
	}
} 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 ans = 0;
		for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		}

		System.out.println(A + B + C);
	}
} 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 ans = 0;
		for (int i = 0; i < K; i++){
			if (A > B){
				if (A > C){
					A *= 2;
				}else{
					C *= 2;
				}
			}else{
				if (B > C){
					B *= 2;
				}else{
					C *= 2;
				}
			}

		}

		System.out.println(A + B + C);
	}
}
