import java.util.*;
 class Main{

     public static void main(String []args){
        Scanner scan = new Scanner(System.in);
        ArrayList<Integer> a = new ArrayList<>();
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        int n =scan.nextInt();
        int x = Collections.max(a) ;
        for(int i = 0 ; i<n ;i++){
        	x = x*2 ;
        }
       
        
        a.remove(Collections.max(a));
        a.add(x);
        int sum = 0;
        for(Integer u : a){
            sum+=u;
        }
        System.out.println(sum);
        
        
        
      
     }
} import java.util.*; util.* java class Main{

     public static void main(String []args){
        Scanner scan = new Scanner(System.in);
        ArrayList<Integer> a = new ArrayList<>();
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        int n =scan.nextInt();
        int x = Collections.max(a) ;
        for(int i = 0 ; i<n ;i++){
        	x = x*2 ;
        }
       
        
        a.remove(Collections.max(a));
        a.add(x);
        int sum = 0;
        for(Integer u : a){
            sum+=u;
        }
        System.out.println(sum);
        
        
        
      
     }
} Main public static void main(String []args){
        Scanner scan = new Scanner(System.in);
        ArrayList<Integer> a = new ArrayList<>();
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        int n =scan.nextInt();
        int x = Collections.max(a) ;
        for(int i = 0 ; i<n ;i++){
        	x = x*2 ;
        }
       
        
        a.remove(Collections.max(a));
        a.add(x);
        int sum = 0;
        for(Integer u : a){
            sum+=u;
        }
        System.out.println(sum);
        
        
        
      
     } main {
        Scanner scan = new Scanner(System.in);
        ArrayList<Integer> a = new ArrayList<>();
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        int n =scan.nextInt();
        int x = Collections.max(a) ;
        for(int i = 0 ; i<n ;i++){
        	x = x*2 ;
        }
       
        
        a.remove(Collections.max(a));
        a.add(x);
        int sum = 0;
        for(Integer u : a){
            sum+=u;
        }
        System.out.println(sum);
        
        
        
      
     } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) ArrayList<Integer> a = new ArrayList<>(); a new ArrayList<>() a.add(scan.nextInt()) a.add a scan.nextInt() scan.nextInt scan a.add(scan.nextInt()) a.add a scan.nextInt() scan.nextInt scan a.add(scan.nextInt()) a.add a scan.nextInt() scan.nextInt scan int n =scan.nextInt(); n scan.nextInt() scan.nextInt scan int x = Collections.max(a) ; x Collections.max(a) Collections.max Collections a for(int i = 0 ; i<n ;i++){
        	x = x*2 ;
        } int i = 0 ; int i = 0 ; i 0 i<n i n i++ i++ i {
        	x = x*2 ;
        } {
        	x = x*2 ;
        } x = x*2 x x*2 x 2 a.remove(Collections.max(a)) a.remove a Collections.max(a) Collections.max Collections a a.add(x) a.add a x int sum = 0; sum 0 for(Integer u : a){
            sum+=u;
        } Integer u a {
            sum+=u;
        } {
            sum+=u;
        } sum+=u sum u System.out.println(sum) System.out.println System.out System System.out sum String []args args
import java.util.*;
 class Main{

     public static void main(String []args){
        Scanner scan = new Scanner(System.in);
        ArrayList<Integer> a = new ArrayList<>();
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        a.add(scan.nextInt());
        int n =scan.nextInt();
        int x = Collections.max(a) ;
        for(int i = 0 ; i<n ;i++){
        	x = x*2 ;
        }
       
        
        a.remove(Collections.max(a));
        a.add(x);
        int sum = 0;
        for(Integer u : a){
            sum+=u;
        }
        System.out.println(sum);
        
        
        
      
     }
}