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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(nums);
        int k = sc.nextInt();
        int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k));
        System.out.println(ans);
    }

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(nums);
        int k = sc.nextInt();
        int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k));
        System.out.println(ans);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(nums);
        int k = sc.nextInt();
        int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k));
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(nums);
        int k = sc.nextInt();
        int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k));
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()}; nums {sc.nextInt(), sc.nextInt(), sc.nextInt()} sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc Arrays.sort(nums) Arrays.sort Arrays nums int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k)); ans nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k)) nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k)) nums[0] nums 0 nums[1] nums 1 (int) (nums[2] * Math.pow(2, k)) nums[2] nums 2 Math.pow(2, k) Math.pow Math 2 k System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(nums);
        int k = sc.nextInt();
        int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k));
        System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(nums);
        int k = sc.nextInt();
        int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k));
        System.out.println(ans);
    }

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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = {sc.nextInt(), sc.nextInt(), sc.nextInt()};
        Arrays.sort(nums);
        int k = sc.nextInt();
        int ans = nums[0] + nums[1] + (int) (nums[2] * Math.pow(2, k));
        System.out.println(ans);
    }

}
