import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();

		for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		}
		int sum = A + B + C;
		System.out.println(sum);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();

		for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		}
		int sum = A + B + C;
		System.out.println(sum);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();

		for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		}
		int sum = A + B + C;
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();

		for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		}
		int sum = A + B + C;
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		} int i = 1; int i = 1; i 1 i <= K i K i++ i++ i {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		} {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		} int tmp = Math.max(Math.max(A, B), C); tmp Math.max(Math.max(A, B), C) Math.max Math Math.max(A, B) Math.max Math A B C if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			} tmp == A tmp A {
				A *= 2;
			} A *= 2 A 2 if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			} tmp == B tmp B {
				B *= 2;
			} B *= 2 B 2 {
				C *= 2;
			} C *= 2 C 2 int sum = A + B + C; sum A + B + C A + B + C A B C System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();

		for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		}
		int sum = A + B + C;
		System.out.println(sum);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();

		for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		}
		int sum = A + B + C;
		System.out.println(sum);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		int K = Integer.parseInt(sc.next());
		sc.close();

		for(int i = 1; i <= K; i++) {
			int tmp = Math.max(Math.max(A, B), C);
			if(tmp == A) {
				A *= 2;
			}else if(tmp == B) {
				B *= 2;
			}else {
				C *= 2;
			}
		}
		int sum = A + B + C;
		System.out.println(sum);
	}

}