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();
		int sum = 0;

		if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		}
		System.out.println(sum);
	}

	public static int countUp(int baseCount, int roopCount) {
		for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		}
		return baseCount;
	}
} 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();
		int sum = 0;

		if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		}
		System.out.println(sum);
	}

	public static int countUp(int baseCount, int roopCount) {
		for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		}
		return baseCount;
	}
} 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 sum = 0;

		if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();
		int sum = 0;

		if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		}
		System.out.println(sum);
	} 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 sum = 0; sum 0 if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		} A >= B && A >= C A >= B A B A >= C A C {
			sum = countUp(A, K) + B + C;
		} sum = countUp(A, K) + B + C sum countUp(A, K) + B + C countUp(A, K) + B + C countUp(A, K) countUp A K B C if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		} B >= A && B >= C B >= A B A B >= C B C {
			sum = countUp(B, K) + A + C;
		} sum = countUp(B, K) + A + C sum countUp(B, K) + A + C countUp(B, K) + A + C countUp(B, K) countUp B K A C {
			sum = countUp(C, K) + A + B;
		} sum = countUp(C, K) + A + B sum countUp(C, K) + A + B countUp(C, K) + A + B countUp(C, K) countUp C K A B System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static int countUp(int baseCount, int roopCount) {
		for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		}
		return baseCount;
	} countUp {
		for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		}
		return baseCount;
	} for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		} int i = 1; int i = 1; i 1 i <= roopCount i roopCount i++ i++ i {
			baseCount = baseCount*2;
		} {
			baseCount = baseCount*2;
		} baseCount = baseCount*2 baseCount baseCount*2 baseCount 2 return baseCount; baseCount int baseCount baseCount int roopCount roopCount 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 sum = 0;

		if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		}
		System.out.println(sum);
	}

	public static int countUp(int baseCount, int roopCount) {
		for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		}
		return baseCount;
	}
} 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 sum = 0;

		if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		}
		System.out.println(sum);
	}

	public static int countUp(int baseCount, int roopCount) {
		for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		}
		return baseCount;
	}
} 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();
		int sum = 0;

		if (A >= B && A >= C) {
			sum = countUp(A, K) + B + C;
		} else if (B >= A && B >= C) {
			sum = countUp(B, K) + A + C;
		} else {
			sum = countUp(C, K) + A + B;
		}
		System.out.println(sum);
	}

	public static int countUp(int baseCount, int roopCount) {
		for (int i = 1; i <= roopCount ; i++) {
			baseCount = baseCount*2;
		}
		return baseCount;
	}
}
