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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		Arrays.sort(array);
		int K = sc.nextInt();
		System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]);
	}
} 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[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		Arrays.sort(array);
		int K = sc.nextInt();
		System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		Arrays.sort(array);
		int K = sc.nextInt();
		System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		Arrays.sort(array);
		int K = sc.nextInt();
		System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() }; array { sc.nextInt(), sc.nextInt(), sc.nextInt() } sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc Arrays.sort(array) Arrays.sort Arrays array int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]) System.out.println System.out System System.out (int)(array[2] * Math.pow(2, K)) + array[1] + array[0] (int)(array[2] * Math.pow(2, K)) + array[1] + array[0] (int)(array[2] * Math.pow(2, K)) array[2] array 2 Math.pow(2, K) Math.pow Math 2 K array[1] array 1 array[0] array 0 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		Arrays.sort(array);
		int K = sc.nextInt();
		System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		Arrays.sort(array);
		int K = sc.nextInt();
		System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]);
	}
} 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[] array = { sc.nextInt(), sc.nextInt(), sc.nextInt() };
		Arrays.sort(array);
		int K = sc.nextInt();
		System.out.println((int)(array[2] * Math.pow(2, K)) + array[1] + array[0]);
	}
}