import java.util.Scanner;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    }
} Main public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args void solve() {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    } solve {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    } 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 ans = Math.max(A, Math.max(C, B)); ans Math.max(A, Math.max(C, B)) Math.max Math A Math.max(C, B) Math.max Math C B int ch = Math.max(A, Math.max(C, B)); ch Math.max(A, Math.max(C, B)) Math.max Math A Math.max(C, B) Math.max Math C B for (int i = 0; i < K; i++) {
            ans = ans * 2;
        } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
            ans = ans * 2;
        } {
            ans = ans * 2;
        } ans = ans * 2 ans ans * 2 ans 2 if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        } ch == A ch A {
            System.out.println(ans + B + C);
        } System.out.println(ans + B + C) System.out.println System.out System System.out ans + B + C ans + B + C ans B C if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        } ch == B ch B {
            System.out.println(ans + A + C);
        } System.out.println(ans + A + C) System.out.println System.out System System.out ans + A + C ans + A + C ans A C {
            System.out.println(ans + A + B);
        } System.out.println(ans + A + B) System.out.println System.out System System.out ans + A + B ans + A + B ans A B public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    }
} public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    }
}