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();
		scan.close();
		int ans = 0;
		if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		}
		System.out.println(ans);

	}
} 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();
		scan.close();
		int ans = 0;
		if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		}
		System.out.println(ans);

	}
} 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();
		scan.close();
		int ans = 0;
		if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		}
		System.out.println(ans);

	} main {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		scan.close();
		int ans = 0;
		if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		}
		System.out.println(ans);

	} 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 scan.close() scan.close scan int ans = 0; ans 0 if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		} A >= B && A >= C A >= B A B A >= C A C {
			ans = A * (int)Math.pow(2, K) + B + C;
		} ans = A * (int)Math.pow(2, K) + B + C ans A * (int)Math.pow(2, K) + B + C A * (int)Math.pow(2, K) + B + C A * (int)Math.pow(2, K) A (int)Math.pow(2, K) Math.pow Math 2 K B C if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		} B >= A && B >= C B >= A B A B >= C B C {
			ans = B * (int)Math.pow(2, K) + A + C;
		} ans = B * (int)Math.pow(2, K) + A + C ans B * (int)Math.pow(2, K) + A + C B * (int)Math.pow(2, K) + A + C B * (int)Math.pow(2, K) B (int)Math.pow(2, K) Math.pow Math 2 K A C if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		} C >= A && C >= B C >= A C A C >= B C B {
			ans = C * (int)Math.pow(2, K) + A + B;
		} ans = C * (int)Math.pow(2, K) + A + B ans C * (int)Math.pow(2, K) + A + B C * (int)Math.pow(2, K) + A + B C * (int)Math.pow(2, K) C (int)Math.pow(2, K) Math.pow Math 2 K A B System.out.println(ans) System.out.println System.out System System.out ans 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();
		scan.close();
		int ans = 0;
		if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		}
		System.out.println(ans);

	}
} 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();
		scan.close();
		int ans = 0;
		if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		}
		System.out.println(ans);

	}
} 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();
		scan.close();
		int ans = 0;
		if(A >= B && A >= C) {
			ans = A * (int)Math.pow(2, K) + B + C;
		}else if(B >= A && B >= C) {
			ans = B * (int)Math.pow(2, K) + A + C;
		}else if(C >= A && C >= B) {
			ans = C * (int)Math.pow(2, K) + A + B;
		}
		System.out.println(ans);

	}
}