import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        array[0] = sc.nextInt();
        array[1] = sc.nextInt();
        array[2] = sc.nextInt();
        Arrays.sort(array);
        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            array[2] *= 2;
        }
        System.out.println(array[0] + array[1] + array[2]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        array[0] = sc.nextInt();
        array[1] = sc.nextInt();
        array[2] = sc.nextInt();
        Arrays.sort(array);
        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            array[2] *= 2;
        }
        System.out.println(array[0] + array[1] + array[2]);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        array[0] = sc.nextInt();
        array[1] = sc.nextInt();
        array[2] = sc.nextInt();
        Arrays.sort(array);
        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            array[2] *= 2;
        }
        System.out.println(array[0] + array[1] + array[2]);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        array[0] = sc.nextInt();
        array[1] = sc.nextInt();
        array[2] = sc.nextInt();
        Arrays.sort(array);
        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            array[2] *= 2;
        }
        System.out.println(array[0] + array[1] + array[2]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] array = new int[3]; array new int[3] 3 array[0] = sc.nextInt() array[0] array 0 sc.nextInt() sc.nextInt sc array[1] = sc.nextInt() array[1] array 1 sc.nextInt() sc.nextInt sc array[2] = sc.nextInt() array[2] array 2 sc.nextInt() sc.nextInt sc Arrays.sort(array) Arrays.sort Arrays array int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc for (int i = 0; i < k; i++) {
            array[2] *= 2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            array[2] *= 2;
        } {
            array[2] *= 2;
        } array[2] *= 2 array[2] array 2 2 System.out.println(array[0] + array[1] + array[2]) System.out.println System.out System System.out array[0] + array[1] + array[2] array[0] + array[1] + array[2] array[0] array 0 array[1] array 1 array[2] array 2 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        array[0] = sc.nextInt();
        array[1] = sc.nextInt();
        array[2] = sc.nextInt();
        Arrays.sort(array);
        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            array[2] *= 2;
        }
        System.out.println(array[0] + array[1] + array[2]);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        array[0] = sc.nextInt();
        array[1] = sc.nextInt();
        array[2] = sc.nextInt();
        Arrays.sort(array);
        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            array[2] *= 2;
        }
        System.out.println(array[0] + array[1] + array[2]);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] array = new int[3];
        array[0] = sc.nextInt();
        array[1] = sc.nextInt();
        array[2] = sc.nextInt();
        Arrays.sort(array);
        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            array[2] *= 2;
        }
        System.out.println(array[0] + array[1] + array[2]);
    }
}
