import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
        System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)));
        


    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
        System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)));
        


    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
        System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)));
        


    } main {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
        System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)));
        


    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a=sc.nextInt() a sc.nextInt() sc.nextInt sc b=sc.nextInt() b sc.nextInt() sc.nextInt sc c=sc.nextInt() c sc.nextInt() sc.nextInt sc k=sc.nextInt(); k sc.nextInt() sc.nextInt sc System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1))) System.out.println System.out System System.out (int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)) c a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1) a b c Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1) Math.max(a,Math.max(b,c)) Math.max Math a Math.max(b,c) Math.max Math b c (Math.pow(2,k)-1) Math.pow(2,k) Math.pow Math 2 k 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
        System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)));
        


    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
        System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)));
        


    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
        System.out.println((int)(a+b+c+Math.max(a,Math.max(b,c))*(Math.pow(2,k)-1)));
        


    }
}