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

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();

        int[] arr = {a, b, c};
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) arr[2] *= 2;
        System.out.println(Arrays.stream(arr).sum());
    }
} import java.util.Arrays; Arrays 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 = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();

        int[] arr = {a, b, c};
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) arr[2] *= 2;
        System.out.println(Arrays.stream(arr).sum());
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();

        int[] arr = {a, b, c};
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) arr[2] *= 2;
        System.out.println(Arrays.stream(arr).sum());
    } main {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();

        int[] arr = {a, b, c};
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) arr[2] *= 2;
        System.out.println(Arrays.stream(arr).sum());
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) 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[] arr = {a, b, c}; arr {a, b, c} a b c Arrays.sort(arr) Arrays.sort Arrays arr for (int i = 0; i < k; i++) arr[2] *= 2; int i = 0; int i = 0; i 0 i < k i k i++ i++ i arr[2] *= 2; arr[2] *= 2 arr[2] arr 2 2 System.out.println(Arrays.stream(arr).sum()) System.out.println System.out System System.out Arrays.stream(arr).sum() Arrays.stream(arr).sum Arrays.stream(arr) Arrays.stream Arrays arr String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();

        int[] arr = {a, b, c};
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) arr[2] *= 2;
        System.out.println(Arrays.stream(arr).sum());
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();

        int[] arr = {a, b, c};
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) arr[2] *= 2;
        System.out.println(Arrays.stream(arr).sum());
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int k = scanner.nextInt();

        int[] arr = {a, b, c};
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) arr[2] *= 2;
        System.out.println(Arrays.stream(arr).sum());
    }
}