 import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

        int A = readInt();
        int B = readInt();
        int C = readInt();

        int K = readInt();

        int BIG = Math.max(A, Math.max(B, C));

        int ans;

        K = (int) Math.pow((double)2, (double)K);

        if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        }

        System.out.println(ans);


    }

    private static int readInt(){
        return Integer.parseInt(sc.next());
    }

    private static long readLong(){
        return Long.parseLong(sc.next());
    }

} import java.util.Scanner; Scanner java.util public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

        int A = readInt();
        int B = readInt();
        int C = readInt();

        int K = readInt();

        int BIG = Math.max(A, Math.max(B, C));

        int ans;

        K = (int) Math.pow((double)2, (double)K);

        if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        }

        System.out.println(ans);


    }

    private static int readInt(){
        return Integer.parseInt(sc.next());
    }

    private static long readLong(){
        return Long.parseLong(sc.next());
    }

} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {

        int A = readInt();
        int B = readInt();
        int C = readInt();

        int K = readInt();

        int BIG = Math.max(A, Math.max(B, C));

        int ans;

        K = (int) Math.pow((double)2, (double)K);

        if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        }

        System.out.println(ans);


    } main {

        int A = readInt();
        int B = readInt();
        int C = readInt();

        int K = readInt();

        int BIG = Math.max(A, Math.max(B, C));

        int ans;

        K = (int) Math.pow((double)2, (double)K);

        if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        }

        System.out.println(ans);


    } int A = readInt(); A readInt() readInt int B = readInt(); B readInt() readInt int C = readInt(); C readInt() readInt int K = readInt(); K readInt() readInt int BIG = Math.max(A, Math.max(B, C)); BIG Math.max(A, Math.max(B, C)) Math.max Math A Math.max(B, C) Math.max Math B C int ans; ans K = (int) Math.pow((double)2, (double)K) K (int) Math.pow((double)2, (double)K) Math.pow Math (double)2 (double)K if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        } A == BIG A BIG {
            ans = A*K + B + C;
        } ans = A*K + B + C ans A*K + B + C A*K + B + C A*K A K B C if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        } B == BIG B BIG {
            ans = A + B*K + C;
        } ans = A + B*K + C ans A + B*K + C A + B*K + C A B*K B K C {
            ans = A + B + C*K;
        } ans = A + B + C*K ans A + B + C*K A + B + C*K A B C*K C K System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static int readInt(){
        return Integer.parseInt(sc.next());
    } readInt {
        return Integer.parseInt(sc.next());
    } return Integer.parseInt(sc.next()); Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc private static long readLong(){
        return Long.parseLong(sc.next());
    } readLong {
        return Long.parseLong(sc.next());
    } return Long.parseLong(sc.next()); Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

        int A = readInt();
        int B = readInt();
        int C = readInt();

        int K = readInt();

        int BIG = Math.max(A, Math.max(B, C));

        int ans;

        K = (int) Math.pow((double)2, (double)K);

        if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        }

        System.out.println(ans);


    }

    private static int readInt(){
        return Integer.parseInt(sc.next());
    }

    private static long readLong(){
        return Long.parseLong(sc.next());
    }

} public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

        int A = readInt();
        int B = readInt();
        int C = readInt();

        int K = readInt();

        int BIG = Math.max(A, Math.max(B, C));

        int ans;

        K = (int) Math.pow((double)2, (double)K);

        if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        }

        System.out.println(ans);


    }

    private static int readInt(){
        return Integer.parseInt(sc.next());
    }

    private static long readLong(){
        return Long.parseLong(sc.next());
    }

} Main
 import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

        int A = readInt();
        int B = readInt();
        int C = readInt();

        int K = readInt();

        int BIG = Math.max(A, Math.max(B, C));

        int ans;

        K = (int) Math.pow((double)2, (double)K);

        if(A == BIG){
            ans = A*K + B + C;
        }else if(B == BIG){
            ans = A + B*K + C;
        }else{
            ans = A + B + C*K;
        }

        System.out.println(ans);


    }

    private static int readInt(){
        return Integer.parseInt(sc.next());
    }

    private static long readLong(){
        return Long.parseLong(sc.next());
    }

}
