import java.util.*;

public class Main {
    public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    }
    
    private void solveA() {
	Scanner sc = new Scanner(System.in);
    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	System.out.println(A <= B ? A: A-1);
    }

    private void solveB() {
	Scanner sc = new Scanner(System.in);
	int[] n = new int[3];
	for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	}
	Arrays.sort(n);

	int k = sc.nextInt();

	for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	}

	System.out.println(n[0] + n[1] + n[2]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    }
    
    private void solveA() {
	Scanner sc = new Scanner(System.in);
    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	System.out.println(A <= B ? A: A-1);
    }

    private void solveB() {
	Scanner sc = new Scanner(System.in);
	int[] n = new int[3];
	for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	}
	Arrays.sort(n);

	int k = sc.nextInt();

	for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	}

	System.out.println(n[0] + n[1] + n[2]);
    }
} Main public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    } main {	
	Main main = new Main();
    	main.solveB();
    } Main main = new Main(); main new Main() main.solveB() main.solveB main String[] args args private void solveA() {
	Scanner sc = new Scanner(System.in);
    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	System.out.println(A <= B ? A: A-1);
    } solveA {
	Scanner sc = new Scanner(System.in);
    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	System.out.println(A <= B ? A: A-1);
    } 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 System.out.println(A <= B ? A: A-1) System.out.println System.out System System.out A <= B ? A: A-1 A <= B A B A A-1 A 1 private void solveB() {
	Scanner sc = new Scanner(System.in);
	int[] n = new int[3];
	for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	}
	Arrays.sort(n);

	int k = sc.nextInt();

	for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	}

	System.out.println(n[0] + n[1] + n[2]);
    } solveB {
	Scanner sc = new Scanner(System.in);
	int[] n = new int[3];
	for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	}
	Arrays.sort(n);

	int k = sc.nextInt();

	for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	}

	System.out.println(n[0] + n[1] + n[2]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] n = new int[3]; n new int[3] 3 for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	} int i=0; int i=0; i 0 i < 3 i 3 i++ i++ i {
	    n[i] = sc.nextInt();	    
	} {
	    n[i] = sc.nextInt();	    
	} n[i] = sc.nextInt() n[i] n i sc.nextInt() sc.nextInt sc Arrays.sort(n) Arrays.sort Arrays n int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	} int i=0; int i=0; i 0 i < k i k i++ i++ i {
	    n[2] = n[2] * 2;	    
	} {
	    n[2] = n[2] * 2;	    
	} n[2] = n[2] * 2 n[2] n 2 n[2] * 2 n[2] n 2 2 System.out.println(n[0] + n[1] + n[2]) System.out.println System.out System System.out n[0] + n[1] + n[2] n[0] + n[1] + n[2] n[0] n 0 n[1] n 1 n[2] n 2 public class Main {
    public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    }
    
    private void solveA() {
	Scanner sc = new Scanner(System.in);
    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	System.out.println(A <= B ? A: A-1);
    }

    private void solveB() {
	Scanner sc = new Scanner(System.in);
	int[] n = new int[3];
	for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	}
	Arrays.sort(n);

	int k = sc.nextInt();

	for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	}

	System.out.println(n[0] + n[1] + n[2]);
    }
} public class Main {
    public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    }
    
    private void solveA() {
	Scanner sc = new Scanner(System.in);
    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	System.out.println(A <= B ? A: A-1);
    }

    private void solveB() {
	Scanner sc = new Scanner(System.in);
	int[] n = new int[3];
	for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	}
	Arrays.sort(n);

	int k = sc.nextInt();

	for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	}

	System.out.println(n[0] + n[1] + n[2]);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    }
    
    private void solveA() {
	Scanner sc = new Scanner(System.in);
    	int A = sc.nextInt();
    	int B = sc.nextInt();
    	System.out.println(A <= B ? A: A-1);
    }

    private void solveB() {
	Scanner sc = new Scanner(System.in);
	int[] n = new int[3];
	for(int i=0; i < 3; i++){
	    n[i] = sc.nextInt();	    
	}
	Arrays.sort(n);

	int k = sc.nextInt();

	for(int i=0; i < k; i++){
	    n[2] = n[2] * 2;	    
	}

	System.out.println(n[0] + n[1] + n[2]);
    }
}