import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// 標準入力
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] nums = br.readLine().split(" ");
		int a = Integer.parseInt(nums[0]);
		int b = Integer.parseInt(nums[1]);
		int c = Integer.parseInt(nums[2]);
		int k = Integer.parseInt(br.readLine());

		int sum = a + b + c;

		int max = 0;
		if (max < a)
			max = a;
		if (max < b)
			max = b;
		if (max < c)
			max = c;

		System.out.println(sum + max * (int) Math.pow(2, k) - max);

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// 標準入力
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] nums = br.readLine().split(" ");
		int a = Integer.parseInt(nums[0]);
		int b = Integer.parseInt(nums[1]);
		int c = Integer.parseInt(nums[2]);
		int k = Integer.parseInt(br.readLine());

		int sum = a + b + c;

		int max = 0;
		if (max < a)
			max = a;
		if (max < b)
			max = b;
		if (max < c)
			max = c;

		System.out.println(sum + max * (int) Math.pow(2, k) - max);

	}

} Main public static void main(String[] args) throws NumberFormatException, IOException {
		// 標準入力
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] nums = br.readLine().split(" ");
		int a = Integer.parseInt(nums[0]);
		int b = Integer.parseInt(nums[1]);
		int c = Integer.parseInt(nums[2]);
		int k = Integer.parseInt(br.readLine());

		int sum = a + b + c;

		int max = 0;
		if (max < a)
			max = a;
		if (max < b)
			max = b;
		if (max < c)
			max = c;

		System.out.println(sum + max * (int) Math.pow(2, k) - max);

	} main {
		// 標準入力
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] nums = br.readLine().split(" ");
		int a = Integer.parseInt(nums[0]);
		int b = Integer.parseInt(nums[1]);
		int c = Integer.parseInt(nums[2]);
		int k = Integer.parseInt(br.readLine());

		int sum = a + b + c;

		int max = 0;
		if (max < a)
			max = a;
		if (max < b)
			max = b;
		if (max < c)
			max = c;

		System.out.println(sum + max * (int) Math.pow(2, k) - max);

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] nums = br.readLine().split(" "); nums br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(nums[0]); a Integer.parseInt(nums[0]) Integer.parseInt Integer nums[0] nums 0 int b = Integer.parseInt(nums[1]); b Integer.parseInt(nums[1]) Integer.parseInt Integer nums[1] nums 1 int c = Integer.parseInt(nums[2]); c Integer.parseInt(nums[2]) Integer.parseInt Integer nums[2] nums 2 int k = Integer.parseInt(br.readLine()); k Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int sum = a + b + c; sum a + b + c a + b + c a b c int max = 0; max 0 if (max < a)
			max = a; max < a max a max = a max a if (max < b)
			max = b; max < b max b max = b max b if (max < c)
			max = c; max < c max c max = c max c System.out.println(sum + max * (int) Math.pow(2, k) - max) System.out.println System.out System System.out sum + max * (int) Math.pow(2, k) - max sum + max * (int) Math.pow(2, k) sum max * (int) Math.pow(2, k) max (int) Math.pow(2, k) Math.pow Math 2 k max String[] args args public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// 標準入力
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] nums = br.readLine().split(" ");
		int a = Integer.parseInt(nums[0]);
		int b = Integer.parseInt(nums[1]);
		int c = Integer.parseInt(nums[2]);
		int k = Integer.parseInt(br.readLine());

		int sum = a + b + c;

		int max = 0;
		if (max < a)
			max = a;
		if (max < b)
			max = b;
		if (max < c)
			max = c;

		System.out.println(sum + max * (int) Math.pow(2, k) - max);

	}

} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// 標準入力
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] nums = br.readLine().split(" ");
		int a = Integer.parseInt(nums[0]);
		int b = Integer.parseInt(nums[1]);
		int c = Integer.parseInt(nums[2]);
		int k = Integer.parseInt(br.readLine());

		int sum = a + b + c;

		int max = 0;
		if (max < a)
			max = a;
		if (max < b)
			max = b;
		if (max < c)
			max = c;

		System.out.println(sum + max * (int) Math.pow(2, k) - max);

	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// 標準入力
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] nums = br.readLine().split(" ");
		int a = Integer.parseInt(nums[0]);
		int b = Integer.parseInt(nums[1]);
		int c = Integer.parseInt(nums[2]);
		int k = Integer.parseInt(br.readLine());

		int sum = a + b + c;

		int max = 0;
		if (max < a)
			max = a;
		if (max < b)
			max = b;
		if (max < c)
			max = c;

		System.out.println(sum + max * (int) Math.pow(2, k) - max);

	}

}
