import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int X;
        
        if(A > B){
            X = A;
            A = B;
            B = X;
        }
        
        if(B > C){
            X = B;
            B = C;
            C = X;
        }
        
        for(int i = 0; i < K; i++){
            C = C * 2;
        }
        
       System.out.println(A + B + C);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int X;
        
        if(A > B){
            X = A;
            A = B;
            B = X;
        }
        
        if(B > C){
            X = B;
            B = C;
            C = X;
        }
        
        for(int i = 0; i < K; i++){
            C = C * 2;
        }
        
       System.out.println(A + B + C);
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int X;
        
        if(A > B){
            X = A;
            A = B;
            B = X;
        }
        
        if(B > C){
            X = B;
            B = C;
            C = X;
        }
        
        for(int i = 0; i < K; i++){
            C = C * 2;
        }
        
       System.out.println(A + B + C);
    } main {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int X;
        
        if(A > B){
            X = A;
            A = B;
            B = X;
        }
        
        if(B > C){
            X = B;
            B = C;
            C = X;
        }
        
        for(int i = 0; i < K; i++){
            C = C * 2;
        }
        
       System.out.println(A + B + C);
    } 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 X; X if(A > B){
            X = A;
            A = B;
            B = X;
        } A > B A B {
            X = A;
            A = B;
            B = X;
        } X = A X A A = B A B B = X B X if(B > C){
            X = B;
            B = C;
            C = X;
        } B > C B C {
            X = B;
            B = C;
            C = X;
        } X = B X B B = C B C C = X C X for(int i = 0; i < K; i++){
            C = C * 2;
        } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
            C = C * 2;
        } {
            C = C * 2;
        } C = C * 2 C C * 2 C 2 System.out.println(A + B + C) System.out.println System.out System System.out A + B + C A + B + C A B C String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int X;
        
        if(A > B){
            X = A;
            A = B;
            B = X;
        }
        
        if(B > C){
            X = B;
            B = C;
            C = X;
        }
        
        for(int i = 0; i < K; i++){
            C = C * 2;
        }
        
       System.out.println(A + B + C);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int X;
        
        if(A > B){
            X = A;
            A = B;
            B = X;
        }
        
        if(B > C){
            X = B;
            B = C;
            C = X;
        }
        
        for(int i = 0; i < K; i++){
            C = C * 2;
        }
        
       System.out.println(A + B + C);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int X;
        
        if(A > B){
            X = A;
            A = B;
            B = X;
        }
        
        if(B > C){
            X = B;
            B = C;
            C = X;
        }
        
        for(int i = 0; i < K; i++){
            C = C * 2;
        }
        
       System.out.println(A + B + C);
    }
}