import 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 = a;
		if (b > max) {
			max = b;
		}
		if (c > max) {
			max = c;
		}
		
		int x = max;
		for (int i = 0; i < k; i++) {
			x = x*2;
		}

		int ans = x + a + b + c - max;

		// 出力
		System.out.println(ans);

		sc.close();

	}
} import java.util.*; util.* java 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 = a;
		if (b > max) {
			max = b;
		}
		if (c > max) {
			max = c;
		}
		
		int x = max;
		for (int i = 0; i < k; i++) {
			x = x*2;
		}

		int ans = x + a + b + c - max;

		// 出力
		System.out.println(ans);

		sc.close();

	}
} 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 = a;
		if (b > max) {
			max = b;
		}
		if (c > max) {
			max = c;
		}
		
		int x = max;
		for (int i = 0; i < k; i++) {
			x = x*2;
		}

		int ans = x + a + b + c - max;

		// 出力
		System.out.println(ans);

		sc.close();

	} 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 = a;
		if (b > max) {
			max = b;
		}
		if (c > max) {
			max = c;
		}
		
		int x = max;
		for (int i = 0; i < k; i++) {
			x = x*2;
		}

		int ans = x + a + b + c - max;

		// 出力
		System.out.println(ans);

		sc.close();

	} 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 = a; max a if (b > max) {
			max = b;
		} b > max b max {
			max = b;
		} max = b max b if (c > max) {
			max = c;
		} c > max c max {
			max = c;
		} max = c max c int x = max; x max for (int i = 0; i < k; i++) {
			x = x*2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			x = x*2;
		} {
			x = x*2;
		} x = x*2 x x*2 x 2 int ans = x + a + b + c - max; ans x + a + b + c - max x + a + b + c b x + a + b + c x a b c max 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 = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int k = sc.nextInt();
		
		int max = a;
		if (b > max) {
			max = b;
		}
		if (c > max) {
			max = c;
		}
		
		int x = max;
		for (int i = 0; i < k; i++) {
			x = x*2;
		}

		int ans = x + a + b + c - max;

		// 出力
		System.out.println(ans);

		sc.close();

	}
} 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 = a;
		if (b > max) {
			max = b;
		}
		if (c > max) {
			max = c;
		}
		
		int x = max;
		for (int i = 0; i < k; i++) {
			x = x*2;
		}

		int ans = x + a + b + c - max;

		// 出力
		System.out.println(ans);

		sc.close();

	}
} Main
import 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 = a;
		if (b > max) {
			max = b;
		}
		if (c > max) {
			max = c;
		}
		
		int x = max;
		for (int i = 0; i < k; i++) {
			x = x*2;
		}

		int ans = x + a + b + c - max;

		// 出力
		System.out.println(ans);

		sc.close();

	}
}