import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();
        int max = Math.max(Math.max(a, b), c);
        System.out.println(a + b + c - max + (max << k));
    }
} import java.util.*; util.* java public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();
        int max = Math.max(Math.max(a, b), c);
        System.out.println(a + b + c - max + (max << k));
    }
} Main static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();
        int max = Math.max(Math.max(a, b), c);
        System.out.println(a + b + c - max + (max << k));
    } main {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();
        int max = Math.max(Math.max(a, b), c);
        System.out.println(a + b + c - max + (max << k));
    } int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int c = scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner int max = Math.max(Math.max(a, b), c); max Math.max(Math.max(a, b), c) Math.max Math Math.max(a, b) Math.max Math a b c System.out.println(a + b + c - max + (max << k)) System.out.println System.out System System.out a + b + c - max + (max << k) a + b + c - max a + b + c a + b + c a b c max (max << k) max k String[]$ $ public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();
        int max = Math.max(Math.max(a, b), c);
        System.out.println(a + b + c - max + (max << k));
    }
} public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();
        int max = Math.max(Math.max(a, b), c);
        System.out.println(a + b + c - max + (max << k));
    }
} Main
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();
        int max = Math.max(Math.max(a, b), c);
        System.out.println(a + b + c - max + (max << k));
    }
}