import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        int number1 = scan.nextInt();
        int number2 = scan.nextInt();
        int number3 = scan.nextInt();
        
        int multiplier = scan.nextInt();
        
        int [] data = {number1,number2,number3};
        
        int maxnumber = 0;
        
        for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        }
        
        int max = maxnumber;
        
        for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        }
        
        int ans = number1 + number2 + number3 + max - maxnumber;
 
        System.out.println(ans);
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        int number1 = scan.nextInt();
        int number2 = scan.nextInt();
        int number3 = scan.nextInt();
        
        int multiplier = scan.nextInt();
        
        int [] data = {number1,number2,number3};
        
        int maxnumber = 0;
        
        for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        }
        
        int max = maxnumber;
        
        for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        }
        
        int ans = number1 + number2 + number3 + max - maxnumber;
 
        System.out.println(ans);
        
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        int number1 = scan.nextInt();
        int number2 = scan.nextInt();
        int number3 = scan.nextInt();
        
        int multiplier = scan.nextInt();
        
        int [] data = {number1,number2,number3};
        
        int maxnumber = 0;
        
        for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        }
        
        int max = maxnumber;
        
        for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        }
        
        int ans = number1 + number2 + number3 + max - maxnumber;
 
        System.out.println(ans);
        
    } main {
        
        Scanner scan = new Scanner(System.in);
        int number1 = scan.nextInt();
        int number2 = scan.nextInt();
        int number3 = scan.nextInt();
        
        int multiplier = scan.nextInt();
        
        int [] data = {number1,number2,number3};
        
        int maxnumber = 0;
        
        for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        }
        
        int max = maxnumber;
        
        for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        }
        
        int ans = number1 + number2 + number3 + max - maxnumber;
 
        System.out.println(ans);
        
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int number1 = scan.nextInt(); number1 scan.nextInt() scan.nextInt scan int number2 = scan.nextInt(); number2 scan.nextInt() scan.nextInt scan int number3 = scan.nextInt(); number3 scan.nextInt() scan.nextInt scan int multiplier = scan.nextInt(); multiplier scan.nextInt() scan.nextInt scan int [] data = {number1,number2,number3}; data {number1,number2,number3} number1 number2 number3 int maxnumber = 0; maxnumber 0 for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        } int i = 0; int i = 0; i 0 i < data.length i data.length data data.length i++ i++ i {
            maxnumber = Math.max(maxnumber,data[i]);
        } {
            maxnumber = Math.max(maxnumber,data[i]);
        } maxnumber = Math.max(maxnumber,data[i]) maxnumber Math.max(maxnumber,data[i]) Math.max Math maxnumber data[i] data i int max = maxnumber; max maxnumber for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        } int count = 0 ; int count = 0 ; count 0 count < multiplier count multiplier count++ count++ count {
            max = max * 2;
        } {
            max = max * 2;
        } max = max * 2 max max * 2 max 2 int ans = number1 + number2 + number3 + max - maxnumber; ans number1 + number2 + number3 + max - maxnumber number1 + number2 + number3 + max number3 number1 + number2 + number3 + max number1 number2 number3 max maxnumber 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) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        int number1 = scan.nextInt();
        int number2 = scan.nextInt();
        int number3 = scan.nextInt();
        
        int multiplier = scan.nextInt();
        
        int [] data = {number1,number2,number3};
        
        int maxnumber = 0;
        
        for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        }
        
        int max = maxnumber;
        
        for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        }
        
        int ans = number1 + number2 + number3 + max - maxnumber;
 
        System.out.println(ans);
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        int number1 = scan.nextInt();
        int number2 = scan.nextInt();
        int number3 = scan.nextInt();
        
        int multiplier = scan.nextInt();
        
        int [] data = {number1,number2,number3};
        
        int maxnumber = 0;
        
        for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        }
        
        int max = maxnumber;
        
        for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        }
        
        int ans = number1 + number2 + number3 + max - maxnumber;
 
        System.out.println(ans);
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        int number1 = scan.nextInt();
        int number2 = scan.nextInt();
        int number3 = scan.nextInt();
        
        int multiplier = scan.nextInt();
        
        int [] data = {number1,number2,number3};
        
        int maxnumber = 0;
        
        for(int i = 0; i < data.length; i++){
            maxnumber = Math.max(maxnumber,data[i]);
        }
        
        int max = maxnumber;
        
        for (int count = 0 ; count < multiplier ; count++){
            max = max * 2;
        }
        
        int ans = number1 + number2 + number3 + max - maxnumber;
 
        System.out.println(ans);
        
    }
}