
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 max = 0;
		if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		}
		int tmp = max;
		for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		}
		int ans = a + b + c - max + tmp;
		System.out.println(ans);
	}
} 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 max = 0;
		if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		}
		int tmp = max;
		for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		}
		int ans = a + b + c - max + tmp;
		System.out.println(ans);
	}
} 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 max = 0;
		if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		}
		int tmp = max;
		for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		}
		int ans = a + b + c - max + tmp;
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		// 定型ループ
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		int max = 0;
		if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		}
		int tmp = max;
		for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		}
		int ans = a + b + c - max + tmp;
		System.out.println(ans);
	} 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 max = 0; max 0 if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} a >= b a b {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			} a >= c a c {
				max = a;
			} max = a max a if (b >= c) {
				max = b;
			} else {
				max = c;
			} b >= c b c {
				max = b;
			} max = b max b {
				max = c;
			} max = c max c {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} if (b >= c) {
				max = b;
			} else {
				max = c;
			} b >= c b c {
				max = b;
			} max = b max b {
				max = c;
			} max = c max c int tmp = max; tmp max for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			tmp = tmp * 2;
		} {
			tmp = tmp * 2;
		} tmp = tmp * 2 tmp tmp * 2 tmp 2 int ans = a + b + c - max + tmp; ans a + b + c - max + tmp a + b + c - max a + b + c a + b + c a b c max tmp System.out.println(ans) System.out.println System.out System System.out ans String[] args args 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 max = 0;
		if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		}
		int tmp = max;
		for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		}
		int ans = a + b + c - max + tmp;
		System.out.println(ans);
	}
} 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 max = 0;
		if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		}
		int tmp = max;
		for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		}
		int ans = a + b + c - max + tmp;
		System.out.println(ans);
	}
} 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 max = 0;
		if (a >= b) {
			if (a >= c) {
				max = a;
			} else if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		} else {
			if (b >= c) {
				max = b;
			} else {
				max = c;
			}
		}
		int tmp = max;
		for (int i = 0; i < k; i++) {
			tmp = tmp * 2;
		}
		int ans = a + b + c - max + tmp;
		System.out.println(ans);
	}
}
