import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] abc = scanner.nextLine().split(" ", 3);

        int[] nums = new int[3];
        nums[0] = Integer.parseInt(abc[0]);
        nums[1] = Integer.parseInt(abc[1]);
        nums[2] = Integer.parseInt(abc[2]);
        Arrays.sort(nums);

        int k = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < k; i++) {
            nums[2] *= 2;
        }

        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] abc = scanner.nextLine().split(" ", 3);

        int[] nums = new int[3];
        nums[0] = Integer.parseInt(abc[0]);
        nums[1] = Integer.parseInt(abc[1]);
        nums[2] = Integer.parseInt(abc[2]);
        Arrays.sort(nums);

        int k = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < k; i++) {
            nums[2] *= 2;
        }

        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] abc = scanner.nextLine().split(" ", 3);

        int[] nums = new int[3];
        nums[0] = Integer.parseInt(abc[0]);
        nums[1] = Integer.parseInt(abc[1]);
        nums[2] = Integer.parseInt(abc[2]);
        Arrays.sort(nums);

        int k = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < k; i++) {
            nums[2] *= 2;
        }

        System.out.println(nums[0] + nums[1] + nums[2]);
    } main {
        Scanner scanner = new Scanner(System.in);
        String[] abc = scanner.nextLine().split(" ", 3);

        int[] nums = new int[3];
        nums[0] = Integer.parseInt(abc[0]);
        nums[1] = Integer.parseInt(abc[1]);
        nums[2] = Integer.parseInt(abc[2]);
        Arrays.sort(nums);

        int k = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < k; i++) {
            nums[2] *= 2;
        }

        System.out.println(nums[0] + nums[1] + nums[2]);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] abc = scanner.nextLine().split(" ", 3); abc scanner.nextLine().split(" ", 3) scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " 3 int[] nums = new int[3]; nums new int[3] 3 nums[0] = Integer.parseInt(abc[0]) nums[0] nums 0 Integer.parseInt(abc[0]) Integer.parseInt Integer abc[0] abc 0 nums[1] = Integer.parseInt(abc[1]) nums[1] nums 1 Integer.parseInt(abc[1]) Integer.parseInt Integer abc[1] abc 1 nums[2] = Integer.parseInt(abc[2]) nums[2] nums 2 Integer.parseInt(abc[2]) Integer.parseInt Integer abc[2] abc 2 Arrays.sort(nums) Arrays.sort Arrays nums int k = Integer.parseInt(scanner.nextLine()); k Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner for (int i = 0; i < k; i++) {
            nums[2] *= 2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            nums[2] *= 2;
        } {
            nums[2] *= 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
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] abc = scanner.nextLine().split(" ", 3);

        int[] nums = new int[3];
        nums[0] = Integer.parseInt(abc[0]);
        nums[1] = Integer.parseInt(abc[1]);
        nums[2] = Integer.parseInt(abc[2]);
        Arrays.sort(nums);

        int k = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < k; i++) {
            nums[2] *= 2;
        }

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