import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        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 n = Integer.parseInt(sc.next());
        int[] nums = {a,b,c};
        Arrays.sort(nums);
        int n_times = 0;
        for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        }
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        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 n = Integer.parseInt(sc.next());
        int[] nums = {a,b,c};
        Arrays.sort(nums);
        int n_times = 0;
        for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        }
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} Main public static void main(String[] args) throws Exception {
        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 n = Integer.parseInt(sc.next());
        int[] nums = {a,b,c};
        Arrays.sort(nums);
        int n_times = 0;
        for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        }
        System.out.println(nums[0] + nums[1] + nums[2]);
    } 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 n = Integer.parseInt(sc.next());
        int[] nums = {a,b,c};
        Arrays.sort(nums);
        int n_times = 0;
        for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        }
        System.out.println(nums[0] + nums[1] + nums[2]);
    } 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 n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] nums = {a,b,c}; nums {a,b,c} a b c Arrays.sort(nums) Arrays.sort Arrays nums int n_times = 0; n_times 0 for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            nums[2] = nums[2] * 2;
        } {
            nums[2] = nums[2] * 2;
        } nums[2] = nums[2] * 2 nums[2] nums 2 nums[2] * 2 nums[2] nums 2 2 System.out.println(nums[0] + nums[1] + nums[2]) System.out.println System.out System System.out nums[0] + nums[1] + nums[2] nums[0] + nums[1] + nums[2] nums[0] nums 0 nums[1] nums 1 nums[2] nums 2 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        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 n = Integer.parseInt(sc.next());
        int[] nums = {a,b,c};
        Arrays.sort(nums);
        int n_times = 0;
        for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        }
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        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 n = Integer.parseInt(sc.next());
        int[] nums = {a,b,c};
        Arrays.sort(nums);
        int n_times = 0;
        for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        }
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        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 n = Integer.parseInt(sc.next());
        int[] nums = {a,b,c};
        Arrays.sort(nums);
        int n_times = 0;
        for (int i = 0; i < n; i++) {
            nums[2] = nums[2] * 2;
        }
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
}
