import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int[] num= new int[3];
        int max = 0;
        int maxNum = 0;
        for(int i=0;i<3;i++){
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        }
        int k = scn.nextInt();
        int answer = 0;
        for(int i=0;i<3;i++){
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        }
        System.out.println(answer);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int[] num= new int[3];
        int max = 0;
        int maxNum = 0;
        for(int i=0;i<3;i++){
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        }
        int k = scn.nextInt();
        int answer = 0;
        for(int i=0;i<3;i++){
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        }
        System.out.println(answer);
    }
} Main public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int[] num= new int[3];
        int max = 0;
        int maxNum = 0;
        for(int i=0;i<3;i++){
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        }
        int k = scn.nextInt();
        int answer = 0;
        for(int i=0;i<3;i++){
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        }
        System.out.println(answer);
    } main {
        Scanner scn=new Scanner(System.in);
        int[] num= new int[3];
        int max = 0;
        int maxNum = 0;
        for(int i=0;i<3;i++){
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        }
        int k = scn.nextInt();
        int answer = 0;
        for(int i=0;i<3;i++){
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        }
        System.out.println(answer);
    } Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int[] num= new int[3]; num new int[3] 3 int max = 0; max 0 int maxNum = 0; maxNum 0 for(int i=0;i<3;i++){
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        } {
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        } num[i]=scn.nextInt() num[i] num i scn.nextInt() scn.nextInt scn if(max<num[i]){
                max = num[i];
                maxNum=i;
            } max<num[i] max num[i] num i {
                max = num[i];
                maxNum=i;
            } max = num[i] max num[i] num i maxNum=i maxNum i int k = scn.nextInt(); k scn.nextInt() scn.nextInt scn int answer = 0; answer 0 for(int i=0;i<3;i++){
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        } {
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        } if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            } maxNum==i maxNum i {
                max *= Math.pow(2,k);
                answer += max;
            } max *= Math.pow(2,k) max Math.pow(2,k) Math.pow Math 2 k answer += max answer max {
                answer+=num[i];
            } answer+=num[i] answer num[i] num i System.out.println(answer) System.out.println System.out System System.out answer String arg[] arg
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int[] num= new int[3];
        int max = 0;
        int maxNum = 0;
        for(int i=0;i<3;i++){
            num[i]=scn.nextInt();
            if(max<num[i]){
                max = num[i];
                maxNum=i;
            }
        }
        int k = scn.nextInt();
        int answer = 0;
        for(int i=0;i<3;i++){
            if(maxNum==i){
                max *= Math.pow(2,k);
                answer += max;
            }else{
                answer+=num[i];
            }
        }
        System.out.println(answer);
    }
}