import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), K = sc.nextInt();
		sc.close();
		int max = Math.max(A, Math.max(B, C));
		int max2=max;

		for (int i = 0; i < K; i++) {
			max=max*2;
		}
		System.out.println(max-max2 + A + B + C);
	}
} 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(), B = sc.nextInt(), C = sc.nextInt(), K = sc.nextInt();
		sc.close();
		int max = Math.max(A, Math.max(B, C));
		int max2=max;

		for (int i = 0; i < K; i++) {
			max=max*2;
		}
		System.out.println(max-max2 + A + B + C);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), K = sc.nextInt();
		sc.close();
		int max = Math.max(A, Math.max(B, C));
		int max2=max;

		for (int i = 0; i < K; i++) {
			max=max*2;
		}
		System.out.println(max-max2 + A + B + C);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), K = sc.nextInt();
		sc.close();
		int max = Math.max(A, Math.max(B, C));
		int max2=max;

		for (int i = 0; i < K; i++) {
			max=max*2;
		}
		System.out.println(max-max2 + A + B + C);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt() B sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc K = sc.nextInt(); K sc.nextInt() sc.nextInt sc sc.close() sc.close sc int max = Math.max(A, Math.max(B, C)); max Math.max(A, Math.max(B, C)) Math.max Math A Math.max(B, C) Math.max Math B C int max2=max; max2 max for (int i = 0; i < K; i++) {
			max=max*2;
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			max=max*2;
		} {
			max=max*2;
		} max=max*2 max max*2 max 2 System.out.println(max-max2 + A + B + C) System.out.println System.out System System.out max-max2 + A + B + C B max-max2 + A + B + C max-max2 max max2 A B C String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), K = sc.nextInt();
		sc.close();
		int max = Math.max(A, Math.max(B, C));
		int max2=max;

		for (int i = 0; i < K; i++) {
			max=max*2;
		}
		System.out.println(max-max2 + A + B + C);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), K = sc.nextInt();
		sc.close();
		int max = Math.max(A, Math.max(B, C));
		int max2=max;

		for (int i = 0; i < K; i++) {
			max=max*2;
		}
		System.out.println(max-max2 + A + B + C);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), K = sc.nextInt();
		sc.close();
		int max = Math.max(A, Math.max(B, C));
		int max2=max;

		for (int i = 0; i < K; i++) {
			max=max*2;
		}
		System.out.println(max-max2 + A + B + C);
	}
}
