import java.util.Scanner;

class Main {
    int A, B, C, K;

    Main() {
        Scanner sc = new Scanner(System.in);
        this.A = Integer.parseInt(sc.next());
        this.B = Integer.parseInt(sc.next());
        this.C = Integer.parseInt(sc.next());
        this.K = Integer.parseInt(sc.next());
    }

    void solve() {
        int maxInt = A > B ? 
            (B > C ? A : (C > A ? C : A)) :
            (A > C ? B : (C > B ? C : B));

        int answer = maxInt * (int) Math.pow(2, K);
        if (maxInt == A) {
            answer += B + C;
        } else if (maxInt == B) {
            answer += C + A;
        } else {
            answer += A + B;
        }
        System.out.println(answer);
    }

    public static void main(String[] args) {
        Main m = new Main();
        m.solve();
    }
} import java.util.Scanner; Scanner java.util class Main {
    int A, B, C, K;

    Main() {
        Scanner sc = new Scanner(System.in);
        this.A = Integer.parseInt(sc.next());
        this.B = Integer.parseInt(sc.next());
        this.C = Integer.parseInt(sc.next());
        this.K = Integer.parseInt(sc.next());
    }

    void solve() {
        int maxInt = A > B ? 
            (B > C ? A : (C > A ? C : A)) :
            (A > C ? B : (C > B ? C : B));

        int answer = maxInt * (int) Math.pow(2, K);
        if (maxInt == A) {
            answer += B + C;
        } else if (maxInt == B) {
            answer += C + A;
        } else {
            answer += A + B;
        }
        System.out.println(answer);
    }

    public static void main(String[] args) {
        Main m = new Main();
        m.solve();
    }
} Main int A A B B C C K; K Main() {
        Scanner sc = new Scanner(System.in);
        this.A = Integer.parseInt(sc.next());
        this.B = Integer.parseInt(sc.next());
        this.C = Integer.parseInt(sc.next());
        this.K = Integer.parseInt(sc.next());
    } Main {
        Scanner sc = new Scanner(System.in);
        this.A = Integer.parseInt(sc.next());
        this.B = Integer.parseInt(sc.next());
        this.C = Integer.parseInt(sc.next());
        this.K = Integer.parseInt(sc.next());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) this.A = Integer.parseInt(sc.next()) this.A this this.A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc this.B = Integer.parseInt(sc.next()) this.B this this.B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc this.C = Integer.parseInt(sc.next()) this.C this this.C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc this.K = Integer.parseInt(sc.next()) this.K this this.K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc void solve() {
        int maxInt = A > B ? 
            (B > C ? A : (C > A ? C : A)) :
            (A > C ? B : (C > B ? C : B));

        int answer = maxInt * (int) Math.pow(2, K);
        if (maxInt == A) {
            answer += B + C;
        } else if (maxInt == B) {
            answer += C + A;
        } else {
            answer += A + B;
        }
        System.out.println(answer);
    } solve {
        int maxInt = A > B ? 
            (B > C ? A : (C > A ? C : A)) :
            (A > C ? B : (C > B ? C : B));

        int answer = maxInt * (int) Math.pow(2, K);
        if (maxInt == A) {
            answer += B + C;
        } else if (maxInt == B) {
            answer += C + A;
        } else {
            answer += A + B;
        }
        System.out.println(answer);
    } int maxInt = A > B ? 
            (B > C ? A : (C > A ? C : A)) :
            (A > C ? B : (C > B ? C : B)); maxInt A > B ? 
            (B > C ? A : (C > A ? C : A)) :
            (A > C ? B : (C > B ? C : B)) A > B A B (B > C ? A : (C > A ? C : A)) B > C B C A (C > A ? C : A) C > A C A C A (A > C ? B : (C > B ? C : B)) A > C A C B (C > B ? C : B) C > B C B C B int answer = maxInt * (int) Math.pow(2, K); answer maxInt * (int) Math.pow(2, K) maxInt (int) Math.pow(2, K) Math.pow Math 2 K if (maxInt == A) {
            answer += B + C;
        } else if (maxInt == B) {
            answer += C + A;
        } else {
            answer += A + B;
        } maxInt == A maxInt A {
            answer += B + C;
        } answer += B + C answer B + C B C if (maxInt == B) {
            answer += C + A;
        } else {
            answer += A + B;
        } maxInt == B maxInt B {
            answer += C + A;
        } answer += C + A answer C + A C A {
            answer += A + B;
        } answer += A + B answer A + B A B System.out.println(answer) System.out.println System.out System System.out answer public static void main(String[] args) {
        Main m = new Main();
        m.solve();
    } main {
        Main m = new Main();
        m.solve();
    } Main m = new Main(); m new Main() m.solve() m.solve m String[] args args
import java.util.Scanner;

class Main {
    int A, B, C, K;

    Main() {
        Scanner sc = new Scanner(System.in);
        this.A = Integer.parseInt(sc.next());
        this.B = Integer.parseInt(sc.next());
        this.C = Integer.parseInt(sc.next());
        this.K = Integer.parseInt(sc.next());
    }

    void solve() {
        int maxInt = A > B ? 
            (B > C ? A : (C > A ? C : A)) :
            (A > C ? B : (C > B ? C : B));

        int answer = maxInt * (int) Math.pow(2, K);
        if (maxInt == A) {
            answer += B + C;
        } else if (maxInt == B) {
            answer += C + A;
        } else {
            answer += A + B;
        }
        System.out.println(answer);
    }

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