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

/**
 * Created by Santa on 2016/10/16.
 */
public class Main {

    static int N;
    static long A;
    static long B;
    static long C;
    static int[] map;



    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] s = new int[3];


        s[0] = scanner.nextInt();
        s[1] = scanner.nextInt();
        s[2] = scanner.nextInt();
        int k = scanner.nextInt();


        Arrays.sort(s);

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

        System.out.println(s[0] + s[1] + s[2]);



    }

}
 import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    static int N;
    static long A;
    static long B;
    static long C;
    static int[] map;



    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] s = new int[3];


        s[0] = scanner.nextInt();
        s[1] = scanner.nextInt();
        s[2] = scanner.nextInt();
        int k = scanner.nextInt();


        Arrays.sort(s);

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

        System.out.println(s[0] + s[1] + s[2]);



    }

} Main static int N; N static long A; A static long B; B static long C; C static int[] map; map public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] s = new int[3];


        s[0] = scanner.nextInt();
        s[1] = scanner.nextInt();
        s[2] = scanner.nextInt();
        int k = scanner.nextInt();


        Arrays.sort(s);

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

        System.out.println(s[0] + s[1] + s[2]);



    } main {
        Scanner scanner = new Scanner(System.in);

        int[] s = new int[3];


        s[0] = scanner.nextInt();
        s[1] = scanner.nextInt();
        s[2] = scanner.nextInt();
        int k = scanner.nextInt();


        Arrays.sort(s);

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

        System.out.println(s[0] + s[1] + s[2]);



    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] s = new int[3]; s new int[3] 3 s[0] = scanner.nextInt() s[0] s 0 scanner.nextInt() scanner.nextInt scanner s[1] = scanner.nextInt() s[1] s 1 scanner.nextInt() scanner.nextInt scanner s[2] = scanner.nextInt() s[2] s 2 scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner Arrays.sort(s) Arrays.sort Arrays s for (int i = 0; i < k; i++) {
            s[2] *= 2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            s[2] *= 2;
        } {
            s[2] *= 2;
        } s[2] *= 2 s[2] s 2 2 System.out.println(s[0] + s[1] + s[2]) System.out.println System.out System System.out s[0] + s[1] + s[2] s[0] + s[1] + s[2] s[0] s 0 s[1] s 1 s[2] s 2 String[] args args public class Main {

    static int N;
    static long A;
    static long B;
    static long C;
    static int[] map;



    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] s = new int[3];


        s[0] = scanner.nextInt();
        s[1] = scanner.nextInt();
        s[2] = scanner.nextInt();
        int k = scanner.nextInt();


        Arrays.sort(s);

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

        System.out.println(s[0] + s[1] + s[2]);



    }

} public class Main {

    static int N;
    static long A;
    static long B;
    static long C;
    static int[] map;



    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] s = new int[3];


        s[0] = scanner.nextInt();
        s[1] = scanner.nextInt();
        s[2] = scanner.nextInt();
        int k = scanner.nextInt();


        Arrays.sort(s);

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

        System.out.println(s[0] + s[1] + s[2]);



    }

} Main
import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by Santa on 2016/10/16.
 */
public class Main {

    static int N;
    static long A;
    static long B;
    static long C;
    static int[] map;



    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int[] s = new int[3];


        s[0] = scanner.nextInt();
        s[1] = scanner.nextInt();
        s[2] = scanner.nextInt();
        int k = scanner.nextInt();


        Arrays.sort(s);

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

        System.out.println(s[0] + s[1] + s[2]);



    }

}

