import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        
        List<Long> number = new ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        };
        
        Collections.sort(number, Comparator.reverseOrder());
        
        long K = Long.parseLong(sc.next());
        
        for(long i=0; i<K; i++){
            number.set(0, number.get(0)*2);
        }
        
        System.out.println(number.get(0) + number.get(1) + number.get(2));
    }
} ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        } import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        
        List<Long> number = new ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        };
        
        Collections.sort(number, Comparator.reverseOrder());
        
        long K = Long.parseLong(sc.next());
        
        for(long i=0; i<K; i++){
            number.set(0, number.get(0)*2);
        }
        
        System.out.println(number.get(0) + number.get(1) + number.get(2));
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        
        List<Long> number = new ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        };
        
        Collections.sort(number, Comparator.reverseOrder());
        
        long K = Long.parseLong(sc.next());
        
        for(long i=0; i<K; i++){
            number.set(0, number.get(0)*2);
        }
        
        System.out.println(number.get(0) + number.get(1) + number.get(2));
    } main {
        Scanner sc = new Scanner(System.in);
        
        
        List<Long> number = new ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        };
        
        Collections.sort(number, Comparator.reverseOrder());
        
        long K = Long.parseLong(sc.next());
        
        for(long i=0; i<K; i++){
            number.set(0, number.get(0)*2);
        }
        
        System.out.println(number.get(0) + number.get(1) + number.get(2));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Long> number = new ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        }; number new ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        } Collections.sort(number, Comparator.reverseOrder()) Collections.sort Collections number Comparator.reverseOrder() Comparator.reverseOrder Comparator long K = Long.parseLong(sc.next()); K Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc for(long i=0; i<K; i++){
            number.set(0, number.get(0)*2);
        } long i=0; long i=0; i 0 i<K i K i++ i++ i {
            number.set(0, number.get(0)*2);
        } {
            number.set(0, number.get(0)*2);
        } number.set(0, number.get(0)*2) number.set number 0 number.get(0)*2 number.get(0) number.get number 0 2 System.out.println(number.get(0) + number.get(1) + number.get(2)) System.out.println System.out System System.out number.get(0) + number.get(1) + number.get(2) number.get(0) + number.get(1) + number.get(2) number.get(0) number.get number 0 number.get(1) number.get number 1 number.get(2) number.get number 2 String[] args args
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        
        List<Long> number = new ArrayList<Long>(){
            {
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
                add(Long.parseLong(sc.next()));
            }
        };
        
        Collections.sort(number, Comparator.reverseOrder());
        
        long K = Long.parseLong(sc.next());
        
        for(long i=0; i<K; i++){
            number.set(0, number.get(0)*2);
        }
        
        System.out.println(number.get(0) + number.get(1) + number.get(2));
    }
}