import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int[] arr = new int[] { a, b, c };
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        }
        int result = Arrays.stream(arr).sum();

        // 出力
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int[] arr = new int[] { a, b, c };
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        }
        int result = Arrays.stream(arr).sum();

        // 出力
        System.out.println(result);
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int[] arr = new int[] { a, b, c };
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        }
        int result = Arrays.stream(arr).sum();

        // 出力
        System.out.println(result);
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int[] arr = new int[] { a, b, c };
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        }
        int result = Arrays.stream(arr).sum();

        // 出力
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc int[] arr = new int[] { a, b, c }; arr new int[] { a, b, c } Arrays.sort(arr) Arrays.sort Arrays arr for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            arr[arr.length - 1] *= 2;
        } {
            arr[arr.length - 1] *= 2;
        } arr[arr.length - 1] *= 2 arr[arr.length - 1] arr arr.length - 1 arr.length arr arr.length 1 2 int result = Arrays.stream(arr).sum(); result Arrays.stream(arr).sum() Arrays.stream(arr).sum Arrays.stream(arr) Arrays.stream Arrays arr System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int[] arr = new int[] { a, b, c };
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        }
        int result = Arrays.stream(arr).sum();

        // 出力
        System.out.println(result);
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int[] arr = new int[] { a, b, c };
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        }
        int result = Arrays.stream(arr).sum();

        // 出力
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int[] arr = new int[] { a, b, c };
        Arrays.sort(arr);
        for (int i = 0; i < k; i++) {
            arr[arr.length - 1] *= 2;
        }
        int result = Arrays.stream(arr).sum();

        // 出力
        System.out.println(result);
    }
}
