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();
 
   int[] re = {A,B,C};
   Arrays.sort(re);
   
   int d =1;
   for(int i =0;i<K;i++) d*=2;
 
   System.out.println(re[0]+re[1]+re[2]*d);
 }
} 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();
 
   int[] re = {A,B,C};
   Arrays.sort(re);
   
   int d =1;
   for(int i =0;i<K;i++) d*=2;
 
   System.out.println(re[0]+re[1]+re[2]*d);
 }
} 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();
 
   int[] re = {A,B,C};
   Arrays.sort(re);
   
   int d =1;
   for(int i =0;i<K;i++) d*=2;
 
   System.out.println(re[0]+re[1]+re[2]*d);
 } main {
   Scanner sc = new Scanner(System.in);
 
   int A = sc.nextInt();
   int B = sc.nextInt();
   int C = sc.nextInt();
   int K = sc.nextInt();
 
   int[] re = {A,B,C};
   Arrays.sort(re);
   
   int d =1;
   for(int i =0;i<K;i++) d*=2;
 
   System.out.println(re[0]+re[1]+re[2]*d);
 } 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 int[] re = {A,B,C}; re {A,B,C} A B C Arrays.sort(re) Arrays.sort Arrays re int d =1; d 1 for(int i =0;i<K;i++) d*=2; int i =0; int i =0; i 0 i<K i K i++ i++ i d*=2; d*=2 d 2 System.out.println(re[0]+re[1]+re[2]*d) System.out.println System.out System System.out re[0]+re[1]+re[2]*d re[0]+re[1]+re[2]*d re[0] re 0 re[1] re 1 re[2]*d re[2] re 2 d 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();
 
   int[] re = {A,B,C};
   Arrays.sort(re);
   
   int d =1;
   for(int i =0;i<K;i++) d*=2;
 
   System.out.println(re[0]+re[1]+re[2]*d);
 }
} 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();
 
   int[] re = {A,B,C};
   Arrays.sort(re);
   
   int d =1;
   for(int i =0;i<K;i++) d*=2;
 
   System.out.println(re[0]+re[1]+re[2]*d);
 }
} 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();
 
   int[] re = {A,B,C};
   Arrays.sort(re);
   
   int d =1;
   for(int i =0;i<K;i++) d*=2;
 
   System.out.println(re[0]+re[1]+re[2]*d);
 }
}