import java.util.*;
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;
		int Max = Math.max(A, B);
		Max = Math.max(Max, C);
		double pow = Math.pow(2, K);
		if (Max == A) {
			Ans = (A * (int)pow) + B + C;
		} else if (Max == B) {
			Ans = (B * ((int)pow)) + A + C;
		} else {
			Ans = (C * ((int)pow)) + A + B;
		}
		System.out.println(Ans);
	}
} import java.util.*; util.* java 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;
		int Max = Math.max(A, B);
		Max = Math.max(Max, C);
		double pow = Math.pow(2, K);
		if (Max == A) {
			Ans = (A * (int)pow) + B + C;
		} else if (Max == B) {
			Ans = (B * ((int)pow)) + A + C;
		} else {
			Ans = (C * ((int)pow)) + A + B;
		}
		System.out.println(Ans);
	}
} 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;
		int Max = Math.max(A, B);
		Max = Math.max(Max, C);
		double pow = Math.pow(2, K);
		if (Max == A) {
			Ans = (A * (int)pow) + B + C;
		} else if (Max == B) {
			Ans = (B * ((int)pow)) + A + C;
		} else {
			Ans = (C * ((int)pow)) + A + B;
		}
		System.out.println(Ans);
	} 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;
		int Max = Math.max(A, B);
		Max = Math.max(Max, C);
		double pow = Math.pow(2, K);
		if (Max == A) {
			Ans = (A * (int)pow) + B + C;
		} else if (Max == B) {
			Ans = (B * ((int)pow)) + A + C;
		} else {
			Ans = (C * ((int)pow)) + A + B;
		}
		System.out.println(Ans);
	} 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 int Max = Math.max(A, B); Max Math.max(A, B) Math.max Math A B Max = Math.max(Max, C) Max Math.max(Max, C) Math.max Math Max C double pow = Math.pow(2, K); pow Math.pow(2, K) Math.pow Math 2 K if (Max == A) {
			Ans = (A * (int)pow) + B + C;
		} else if (Max == B) {
			Ans = (B * ((int)pow)) + A + C;
		} else {
			Ans = (C * ((int)pow)) + A + B;
		} Max == A Max A {
			Ans = (A * (int)pow) + B + C;
		} Ans = (A * (int)pow) + B + C Ans (A * (int)pow) + B + C (A * (int)pow) + B + C (A * (int)pow) A (int)pow B C if (Max == B) {
			Ans = (B * ((int)pow)) + A + C;
		} else {
			Ans = (C * ((int)pow)) + A + B;
		} Max == B Max B {
			Ans = (B * ((int)pow)) + A + C;
		} Ans = (B * ((int)pow)) + A + C Ans (B * ((int)pow)) + A + C (B * ((int)pow)) + A + C (B * ((int)pow)) B ((int)pow) A C {
			Ans = (C * ((int)pow)) + A + B;
		} Ans = (C * ((int)pow)) + A + B Ans (C * ((int)pow)) + A + B (C * ((int)pow)) + A + B (C * ((int)pow)) C ((int)pow) A B System.out.println(Ans) System.out.println System.out System System.out Ans String[] args args
import java.util.*;
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;
		int Max = Math.max(A, B);
		Max = Math.max(Max, C);
		double pow = Math.pow(2, K);
		if (Max == A) {
			Ans = (A * (int)pow) + B + C;
		} else if (Max == B) {
			Ans = (B * ((int)pow)) + A + C;
		} else {
			Ans = (C * ((int)pow)) + A + B;
		}
		System.out.println(Ans);
	}
}