import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Integer;

public class Main {

	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		String[] strArray1 = line.split(" ");
		int[] array1 = new int[3];

		for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		}

		line = br.readLine();
		int k = Integer.parseInt(line);

		int max = 0;
		int n = 0;
		int sum = 0;

		for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		}

		for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		}

		for (int i = 0; i < k; i++) {
			max *= 2;
		}

		System.out.println(max+sum);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.lang.Integer; Integer java.lang public class Main {

	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		String[] strArray1 = line.split(" ");
		int[] array1 = new int[3];

		for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		}

		line = br.readLine();
		int k = Integer.parseInt(line);

		int max = 0;
		int n = 0;
		int sum = 0;

		for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		}

		for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		}

		for (int i = 0; i < k; i++) {
			max *= 2;
		}

		System.out.println(max+sum);
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		String[] strArray1 = line.split(" ");
		int[] array1 = new int[3];

		for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		}

		line = br.readLine();
		int k = Integer.parseInt(line);

		int max = 0;
		int n = 0;
		int sum = 0;

		for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		}

		for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		}

		for (int i = 0; i < k; i++) {
			max *= 2;
		}

		System.out.println(max+sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		String[] strArray1 = line.split(" ");
		int[] array1 = new int[3];

		for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		}

		line = br.readLine();
		int k = Integer.parseInt(line);

		int max = 0;
		int n = 0;
		int sum = 0;

		for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		}

		for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		}

		for (int i = 0; i < k; i++) {
			max *= 2;
		}

		System.out.println(max+sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line = br.readLine(); line br.readLine() br.readLine br String[] strArray1 = line.split(" "); strArray1 line.split(" ") line.split line " " int[] array1 = new int[3]; array1 new int[3] 3 for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			array1[i] = Integer.parseInt(strArray1[i]);
		} {
			array1[i] = Integer.parseInt(strArray1[i]);
		} array1[i] = Integer.parseInt(strArray1[i]) array1[i] array1 i Integer.parseInt(strArray1[i]) Integer.parseInt Integer strArray1[i] strArray1 i line = br.readLine() line br.readLine() br.readLine br int k = Integer.parseInt(line); k Integer.parseInt(line) Integer.parseInt Integer line int max = 0; max 0 int n = 0; n 0 int sum = 0; sum 0 for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		} {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		} if (max < array1[i]) {
				max = array1[i];
				n = i;
			} max < array1[i] max array1[i] array1 i {
				max = array1[i];
				n = i;
			} max = array1[i] max array1[i] array1 i n = i n i for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if (i != n) {
				sum += array1[i];
			}
		} {
			if (i != n) {
				sum += array1[i];
			}
		} if (i != n) {
				sum += array1[i];
			} i != n i n {
				sum += array1[i];
			} sum += array1[i] sum array1[i] array1 i for (int i = 0; i < k; i++) {
			max *= 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			max *= 2;
		} {
			max *= 2;
		} max *= 2 max 2 System.out.println(max+sum) System.out.println System.out System System.out max+sum max sum String[] args args public class Main {

	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		String[] strArray1 = line.split(" ");
		int[] array1 = new int[3];

		for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		}

		line = br.readLine();
		int k = Integer.parseInt(line);

		int max = 0;
		int n = 0;
		int sum = 0;

		for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		}

		for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		}

		for (int i = 0; i < k; i++) {
			max *= 2;
		}

		System.out.println(max+sum);
	}
} public class Main {

	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		String[] strArray1 = line.split(" ");
		int[] array1 = new int[3];

		for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		}

		line = br.readLine();
		int k = Integer.parseInt(line);

		int max = 0;
		int n = 0;
		int sum = 0;

		for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		}

		for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		}

		for (int i = 0; i < k; i++) {
			max *= 2;
		}

		System.out.println(max+sum);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Integer;

public class Main {

	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line = br.readLine();
		String[] strArray1 = line.split(" ");
		int[] array1 = new int[3];

		for (int i = 0; i < 3; i++) {
			array1[i] = Integer.parseInt(strArray1[i]);
		}

		line = br.readLine();
		int k = Integer.parseInt(line);

		int max = 0;
		int n = 0;
		int sum = 0;

		for (int i = 0; i < 3; i++) {
			if (max < array1[i]) {
				max = array1[i];
				n = i;
			}
		}

		for (int i = 0; i < 3; i++) {
			if (i != n) {
				sum += array1[i];
			}
		}

		for (int i = 0; i < k; i++) {
			max *= 2;
		}

		System.out.println(max+sum);
	}
}