import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // スペース区切りの整数の入力
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = {a,b,c};
        int max = array[0];
        int result;
        if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        }
            result = (int) (a+b+c-max+(Math.pow(2,k)*max));
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // スペース区切りの整数の入力
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = {a,b,c};
        int max = array[0];
        int result;
        if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        }
            result = (int) (a+b+c-max+(Math.pow(2,k)*max));
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // スペース区切りの整数の入力
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = {a,b,c};
        int max = array[0];
        int result;
        if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        }
            result = (int) (a+b+c-max+(Math.pow(2,k)*max));
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // スペース区切りの整数の入力
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = {a,b,c};
        int max = array[0];
        int result;
        if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        }
            result = (int) (a+b+c-max+(Math.pow(2,k)*max));
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int[] array = {a,b,c}; array {a,b,c} a b c int max = array[0]; max array[0] array 0 int result; result if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        } 1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10 1<=k c<=50 1<=c b<=50 1<=b 1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10 1<=a 1 a a<=50 a 50 1<=b 1 b b<=50 b 50 1<=c 1 c c<=50 c 50 1<=k 1 k k<=10 k 10 {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        } for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            } int j = 0; int j = 0; j 0 j < array.length j array.length array array.length j++ j++ j {
                if(array[j]>max){
                    max=array[j];
                }
            } {
                if(array[j]>max){
                    max=array[j];
                }
            } if(array[j]>max){
                    max=array[j];
                } array[j]>max array[j] array j max {
                    max=array[j];
                } max=array[j] max array[j] array j result = (int) (a+b+c-max+(Math.pow(2,k)*max)) result (int) (a+b+c-max+(Math.pow(2,k)*max)) a+b+c-max a+b+c a+b+c a b c max (Math.pow(2,k)*max) Math.pow(2,k) Math.pow Math 2 k max System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // スペース区切りの整数の入力
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = {a,b,c};
        int max = array[0];
        int result;
        if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        }
            result = (int) (a+b+c-max+(Math.pow(2,k)*max));
        System.out.println(result);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // スペース区切りの整数の入力
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = {a,b,c};
        int max = array[0];
        int result;
        if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        }
            result = (int) (a+b+c-max+(Math.pow(2,k)*max));
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // スペース区切りの整数の入力
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = {a,b,c};
        int max = array[0];
        int result;
        if (1<=a && a<=50 && 1<=b && b<=50 && 1<=c && c<=50 && 1<=k && k<=10) {
            for (int j = 0; j < array.length; j++) {
                if(array[j]>max){
                    max=array[j];
                }
            }
        }
            result = (int) (a+b+c-max+(Math.pow(2,k)*max));
        System.out.println(result);
    }
}
