import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        } {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int A = in.nextInt(); A in.nextInt() in.nextInt in int B = in.nextInt(); B in.nextInt() in.nextInt in int C = in.nextInt(); C in.nextInt() in.nextInt in int K = in.nextInt(); K in.nextInt() in.nextInt in int sum = A + B + C; sum A + B + C A + B + C A B C 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 sum += -max + (max << K) sum -max + (max << K) -max max (max << K) max K 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) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();

            int sum = A + B + C;
            int max = Math.max(A, Math.max(B, C));
            sum += -max + (max << K);

            System.out.println(sum);
        }
    }
}
