import 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();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
} import java.util.*; util.* java 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();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
} 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();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(); 
		int B = sc.nextInt(); 
		int C = sc.nextInt();
		int K = sc.nextInt();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	} 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 for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		} {
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		} if(A > B && A > C){
				A = A*2;
			} A > B && A > C A > B A B A > C A C {
				A = A*2;
			} A = A*2 A A*2 A 2 if(B > A && B > C){
				B = B*2;
			} B > A && B > C B > A B A B > C B C {
				B = B*2;
			} B = B*2 B B*2 B 2 if(C > A && C > B){
				C = C*2;
			} C > A && C > B C > A C A C > B C B {
				C = C*2;
			} C = C*2 C C*2 C 2 if(A == C && A > B){
				A = A*2;
			} A == C && A > B A == C A C A > B A B {
				A = A*2;
			} A = A*2 A A*2 A 2 if(A == B && A > C){
				A = A*2;
			} A == B && A > C A == B A B A > C A C {
				A = A*2;
			} A = A*2 A A*2 A 2 if(B == C && B > A){
				B = B * 2;
			} B == C && B > A B == C B C B > A B A {
				B = B * 2;
			} B = B * 2 B B * 2 B 2 if(A == B && B == C){
				A = A*2;
			} A == B && B == C A == B A B B == C B C {
				A = A*2;
			} A = A*2 A A*2 A 2 int S = A + B + C; S A + B + C A + B + C A B C System.out.println(S) System.out.println System.out System System.out S 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();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
} 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();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
} Main
import 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();
		
		for(int i = 0; i < K; i++){
			if(A > B && A > C){
				A = A*2;
			}
			if(B > A && B > C){
				B = B*2;
			}
			if(C > A && C > B){
				C = C*2;
			}
			
			if(A == C && A > B){
				A = A*2;
			}
			if(A == B && A > C){
				A = A*2;
			}
			if(B == C && B > A){
				B = B * 2;
			}
			if(A == B && B == C){
				A = A*2;
			}
		}
		int S = A + B + C;
		System.out.println(S);
	}
}
