import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0;
                int maxN=0;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }

                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                System.out.println(num[0]+num[1]+num[2]);
        }
}
 import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.Iterator; Iterator java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.Random; Random java.util import java.util.Map; Map java.util import java.util.HashMap; HashMap java.util class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0;
                int maxN=0;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }

                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                System.out.println(num[0]+num[1]+num[2]);
        }
} Main public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0;
                int maxN=0;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }

                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                System.out.println(num[0]+num[1]+num[2]);
        } main {
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0;
                int maxN=0;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }

                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                System.out.println(num[0]+num[1]+num[2]);
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] num = new int[3]; num new int[3] 3 num[0] = sc.nextInt() num[0] num 0 sc.nextInt() sc.nextInt sc num[1] = sc.nextInt() num[1] num 1 sc.nextInt() sc.nextInt sc num[2] = sc.nextInt() num[2] num 2 sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int max=0; max 0 int maxN=0; maxN 0 for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                } {
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                } if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        } max<num[i] max num[i] num i {
                                max = num[i];
                                maxN = i;
                        } max = num[i] max num[i] num i maxN = i maxN i for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2; int i=0; int i=0; i 0 i<K i K i++ i++ i num[maxN] = num[maxN] * 2; num[maxN] = num[maxN] * 2 num[maxN] num maxN num[maxN] * 2 num[maxN] num maxN 2 System.out.println(num[0]+num[1]+num[2]) System.out.println System.out System System.out num[0]+num[1]+num[2] num[0]+num[1]+num[2] num[0] num 0 num[1] num 1 num[2] num 2 String args[] args
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0;
                int maxN=0;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }

                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                System.out.println(num[0]+num[1]+num[2]);
        }
}

