import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		List<Integer> list = new ArrayList<>(3);
		for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		}
		int K = Integer.parseInt(in.readLine());
		Collections.sort(list);
		int result = list.get(0) + list.get(1);
		result += Math.pow(2, K) * list.get(2);
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		List<Integer> list = new ArrayList<>(3);
		for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		}
		int K = Integer.parseInt(in.readLine());
		Collections.sort(list);
		int result = list.get(0) + list.get(1);
		result += Math.pow(2, K) * list.get(2);
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} Main public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} main {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) Main ins = new Main(in); ins new Main(in) ins.calc() ins.calc ins ins.showResult() ins.showResult ins String[] args args Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		List<Integer> list = new ArrayList<>(3);
		for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		}
		int K = Integer.parseInt(in.readLine());
		Collections.sort(list);
		int result = list.get(0) + list.get(1);
		result += Math.pow(2, K) * list.get(2);
		System.out.println(result);

	} Main {
		String[] tokens = in.readLine().split(" ");
		List<Integer> list = new ArrayList<>(3);
		for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		}
		int K = Integer.parseInt(in.readLine());
		Collections.sort(list);
		int result = list.get(0) + list.get(1);
		result += Math.pow(2, K) * list.get(2);
		System.out.println(result);

	} String[] tokens = in.readLine().split(" "); tokens in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " List<Integer> list = new ArrayList<>(3); list new ArrayList<>(3) for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		} int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
			list.add(Integer.parseInt(tokens[i]));
		} {
			list.add(Integer.parseInt(tokens[i]));
		} list.add(Integer.parseInt(tokens[i])) list.add list Integer.parseInt(tokens[i]) Integer.parseInt Integer tokens[i] tokens i int K = Integer.parseInt(in.readLine()); K Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in Collections.sort(list) Collections.sort Collections list int result = list.get(0) + list.get(1); result list.get(0) + list.get(1) list.get(0) list.get list 0 list.get(1) list.get list 1 result += Math.pow(2, K) * list.get(2) result Math.pow(2, K) * list.get(2) Math.pow(2, K) Math.pow Math 2 K list.get(2) list.get list 2 System.out.println(result) System.out.println System.out System System.out result BufferedReader in in void calc() {
	} calc {
	} void showResult() {
	} showResult {
	} public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		List<Integer> list = new ArrayList<>(3);
		for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		}
		int K = Integer.parseInt(in.readLine());
		Collections.sort(list);
		int result = list.get(0) + list.get(1);
		result += Math.pow(2, K) * list.get(2);
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		List<Integer> list = new ArrayList<>(3);
		for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		}
		int K = Integer.parseInt(in.readLine());
		Collections.sort(list);
		int result = list.get(0) + list.get(1);
		result += Math.pow(2, K) * list.get(2);
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} Main
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		List<Integer> list = new ArrayList<>(3);
		for (int i = 0; i < 3; ++i) {
			list.add(Integer.parseInt(tokens[i]));
		}
		int K = Integer.parseInt(in.readLine());
		Collections.sort(list);
		int result = list.get(0) + list.get(1);
		result += Math.pow(2, K) * list.get(2);
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
}