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

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int A = Integer.parseInt(scanner.next());
        int B = Integer.parseInt(scanner.next());
        int C = Integer.parseInt(scanner.next());
        int K = Integer.parseInt(scanner.next());
        scanner.close();

        Integer[] arr = {A, B, C};
        Arrays.sort(arr, Comparator.reverseOrder());

        for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        }

        int sum = 0;
        for (Integer integer : arr) {
            sum += integer;
        }

        System.out.println(sum);
    }
} import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int A = Integer.parseInt(scanner.next());
        int B = Integer.parseInt(scanner.next());
        int C = Integer.parseInt(scanner.next());
        int K = Integer.parseInt(scanner.next());
        scanner.close();

        Integer[] arr = {A, B, C};
        Arrays.sort(arr, Comparator.reverseOrder());

        for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        }

        int sum = 0;
        for (Integer integer : arr) {
            sum += integer;
        }

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

        Integer[] arr = {A, B, C};
        Arrays.sort(arr, Comparator.reverseOrder());

        for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        }

        int sum = 0;
        for (Integer integer : arr) {
            sum += integer;
        }

        System.out.println(sum);
    } main {
        Scanner scanner = new Scanner(System.in);
        int A = Integer.parseInt(scanner.next());
        int B = Integer.parseInt(scanner.next());
        int C = Integer.parseInt(scanner.next());
        int K = Integer.parseInt(scanner.next());
        scanner.close();

        Integer[] arr = {A, B, C};
        Arrays.sort(arr, Comparator.reverseOrder());

        for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        }

        int sum = 0;
        for (Integer integer : arr) {
            sum += integer;
        }

        System.out.println(sum);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int A = Integer.parseInt(scanner.next()); A Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int B = Integer.parseInt(scanner.next()); B Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int C = Integer.parseInt(scanner.next()); C Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner int K = Integer.parseInt(scanner.next()); K Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner scanner.close() scanner.close scanner Integer[] arr = {A, B, C}; arr {A, B, C} A B C Arrays.sort(arr, Comparator.reverseOrder()) Arrays.sort Arrays arr Comparator.reverseOrder() Comparator.reverseOrder Comparator for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
            arr[0] *= 2;
        } {
            arr[0] *= 2;
        } arr[0] *= 2 arr[0] arr 0 2 int sum = 0; sum 0 for (Integer integer : arr) {
            sum += integer;
        } Integer integer arr {
            sum += integer;
        } {
            sum += integer;
        } sum += integer sum integer 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) {
        Scanner scanner = new Scanner(System.in);
        int A = Integer.parseInt(scanner.next());
        int B = Integer.parseInt(scanner.next());
        int C = Integer.parseInt(scanner.next());
        int K = Integer.parseInt(scanner.next());
        scanner.close();

        Integer[] arr = {A, B, C};
        Arrays.sort(arr, Comparator.reverseOrder());

        for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        }

        int sum = 0;
        for (Integer integer : arr) {
            sum += integer;
        }

        System.out.println(sum);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int A = Integer.parseInt(scanner.next());
        int B = Integer.parseInt(scanner.next());
        int C = Integer.parseInt(scanner.next());
        int K = Integer.parseInt(scanner.next());
        scanner.close();

        Integer[] arr = {A, B, C};
        Arrays.sort(arr, Comparator.reverseOrder());

        for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        }

        int sum = 0;
        for (Integer integer : arr) {
            sum += integer;
        }

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

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int A = Integer.parseInt(scanner.next());
        int B = Integer.parseInt(scanner.next());
        int C = Integer.parseInt(scanner.next());
        int K = Integer.parseInt(scanner.next());
        scanner.close();

        Integer[] arr = {A, B, C};
        Arrays.sort(arr, Comparator.reverseOrder());

        for (int i = 0; i < K; i++) {
            arr[0] *= 2;
        }

        int sum = 0;
        for (Integer integer : arr) {
            sum += integer;
        }

        System.out.println(sum);
    }
}
