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 max = Math.max( A, Math.max(B, C) );
        int sum = (int)Math.pow(2, K) * max;
        if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        }
        System.out.println( sum );
    }
} 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 max = Math.max( A, Math.max(B, C) );
        int sum = (int)Math.pow(2, K) * max;
        if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        }
        System.out.println( sum );
    }
} 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 max = Math.max( A, Math.max(B, C) );
        int sum = (int)Math.pow(2, K) * max;
        if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        }
        System.out.println( sum );
    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        
        int max = Math.max( A, Math.max(B, C) );
        int sum = (int)Math.pow(2, K) * max;
        if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        }
        System.out.println( sum );
    } 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 max = Math.max( A, Math.max(B, C) ); max Math.max( A, Math.max(B, C) ) Math.max Math A Math.max(B, C) Math.max Math B C int sum = (int)Math.pow(2, K) * max; sum (int)Math.pow(2, K) * max (int)Math.pow(2, K) Math.pow Math 2 K max if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        } max == A max A {
            sum += B + C;    
        } sum += B + C sum B + C B C if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        } max == B max B {
            sum += C + A;
        } sum += C + A sum C + A C A if( max == C ) {
            sum += A + B;
        } max == C max C {
            sum += A + B;
        } sum += A + B sum A + B A B System.out.println( sum ) System.out.println System.out System System.out sum 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 max = Math.max( A, Math.max(B, C) );
        int sum = (int)Math.pow(2, K) * max;
        if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        }
        System.out.println( sum );
    }
} 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 max = Math.max( A, Math.max(B, C) );
        int sum = (int)Math.pow(2, K) * max;
        if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        }
        System.out.println( sum );
    }
} 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 max = Math.max( A, Math.max(B, C) );
        int sum = (int)Math.pow(2, K) * max;
        if( max == A) {
            sum += B + C;    
        } else if( max == B ) {
            sum += C + A;
        } else if( max == C ) {
            sum += A + B;
        }
        System.out.println( sum );
    }
}
