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

public class Main {

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

    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int [] nums = new int[3];
        for (int i = 0; i < 3; i++) {
            nums[i] = cin.nextInt();
        }
        int k = cin.nextInt();
        Arrays.sort(nums);
        nums[2] = nums [2] << k;
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} Main public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int [] nums = new int[3];
        for (int i = 0; i < 3; i++) {
            nums[i] = cin.nextInt();
        }
        int k = cin.nextInt();
        Arrays.sort(nums);
        nums[2] = nums [2] << k;
        System.out.println(nums[0] + nums[1] + nums[2]);
    } main {
        Scanner cin = new Scanner(System.in);
        int [] nums = new int[3];
        for (int i = 0; i < 3; i++) {
            nums[i] = cin.nextInt();
        }
        int k = cin.nextInt();
        Arrays.sort(nums);
        nums[2] = nums [2] << k;
        System.out.println(nums[0] + nums[1] + nums[2]);
    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int [] nums = new int[3]; nums new int[3] 3 for (int i = 0; i < 3; i++) {
            nums[i] = cin.nextInt();
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            nums[i] = cin.nextInt();
        } {
            nums[i] = cin.nextInt();
        } nums[i] = cin.nextInt() nums[i] nums i cin.nextInt() cin.nextInt cin int k = cin.nextInt(); k cin.nextInt() cin.nextInt cin Arrays.sort(nums) Arrays.sort Arrays nums nums[2] = nums [2] << k nums[2] nums 2 nums [2] << k nums [2] nums 2 k 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) {
        Scanner cin = new Scanner(System.in);
        int [] nums = new int[3];
        for (int i = 0; i < 3; i++) {
            nums[i] = cin.nextInt();
        }
        int k = cin.nextInt();
        Arrays.sort(nums);
        nums[2] = nums [2] << k;
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
} public class Main {

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

public class Main {

    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int [] nums = new int[3];
        for (int i = 0; i < 3; i++) {
            nums[i] = cin.nextInt();
        }
        int k = cin.nextInt();
        Arrays.sort(nums);
        nums[2] = nums [2] << k;
        System.out.println(nums[0] + nums[1] + nums[2]);
    }
}
