import java.util.Scanner;

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();
		System.out.println((int)(A + B + C + Math.max(A,Math.max(B,C))*(Math.pow(2,K) -1)));
	}

} import java.util.Scanner; Scanner 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();
		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();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int 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();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int 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 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 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();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int 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();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int 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.Scanner;

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();
		System.out.println((int)(A + B + C + Math.max(A,Math.max(B,C))*(Math.pow(2,K) -1)));
	}

}
