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

public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] numArr = new int[3];

		for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		}
		int K = s.nextInt();

		Arrays.sort(numArr);

		for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		}
		System.out.println(numArr[2] + numArr[1] + numArr[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 s = new Scanner(System.in);

		int[] numArr = new int[3];

		for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		}
		int K = s.nextInt();

		Arrays.sort(numArr);

		for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		}
		System.out.println(numArr[2] + numArr[1] + numArr[0]);
	}

} Main public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] numArr = new int[3];

		for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		}
		int K = s.nextInt();

		Arrays.sort(numArr);

		for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		}
		System.out.println(numArr[2] + numArr[1] + numArr[0]);
	} main {

		Scanner s = new Scanner(System.in);

		int[] numArr = new int[3];

		for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		}
		int K = s.nextInt();

		Arrays.sort(numArr);

		for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		}
		System.out.println(numArr[2] + numArr[1] + numArr[0]);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int[] numArr = new int[3]; numArr new int[3] 3 for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			numArr[i] = s.nextInt();
		} {
			numArr[i] = s.nextInt();
		} numArr[i] = s.nextInt() numArr[i] numArr i s.nextInt() s.nextInt s int K = s.nextInt(); K s.nextInt() s.nextInt s Arrays.sort(numArr) Arrays.sort Arrays numArr for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			numArr[2] = numArr[2] * 2;
		} {
			numArr[2] = numArr[2] * 2;
		} numArr[2] = numArr[2] * 2 numArr[2] numArr 2 numArr[2] * 2 numArr[2] numArr 2 2 System.out.println(numArr[2] + numArr[1] + numArr[0]) System.out.println System.out System System.out numArr[2] + numArr[1] + numArr[0] numArr[2] + numArr[1] + numArr[0] numArr[2] numArr 2 numArr[1] numArr 1 numArr[0] numArr 0 String[] args args public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] numArr = new int[3];

		for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		}
		int K = s.nextInt();

		Arrays.sort(numArr);

		for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		}
		System.out.println(numArr[2] + numArr[1] + numArr[0]);
	}

} public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] numArr = new int[3];

		for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		}
		int K = s.nextInt();

		Arrays.sort(numArr);

		for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		}
		System.out.println(numArr[2] + numArr[1] + numArr[0]);
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[] numArr = new int[3];

		for (int i = 0; i < 3; i++) {
			numArr[i] = s.nextInt();
		}
		int K = s.nextInt();

		Arrays.sort(numArr);

		for (int i = 0; i < K; i++) {
			numArr[2] = numArr[2] * 2;
		}
		System.out.println(numArr[2] + numArr[1] + numArr[0]);
	}

}
