import java.util.Scanner;

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

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

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

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

} Main
import java.util.Scanner;

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

}
