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 str;
		while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		}
	}
} 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 str;
		while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		}
	}
} Main public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;
		while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;
		while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str; str while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		} (str = br.readLine()) != null (str = br.readLine()) str br.readLine() br.readLine br null {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		} String inputs[] = str.split(" "); inputs str.split(" ") str.split str " " int a = Integer.parseInt(inputs[0]); a Integer.parseInt(inputs[0]) Integer.parseInt Integer inputs[0] inputs 0 int b = Integer.parseInt(inputs[1]); b Integer.parseInt(inputs[1]) Integer.parseInt Integer inputs[1] inputs 1 int c = Integer.parseInt(inputs[2]); c Integer.parseInt(inputs[2]) Integer.parseInt Integer inputs[2] inputs 2 int k = Integer.parseInt(br.readLine()); k Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			} {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			} if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				} a > b && a>c a > b a b a>c a c {
					a *= 2;
				} a *= 2 a 2 if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				} b > c b c {
					b *= 2;
				} b *= 2 b 2 {
					c *= 2;
				} c *= 2 c 2 System.out.println(a+b+c) System.out.println System.out System System.out a+b+c a+b+c a b c String[] args args public class Main {
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;
		while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		}
	}
} public class Main {
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str;
		while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		}
	}
} 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 str;
		while ((str = br.readLine()) != null) {
			String inputs[] = str.split(" ");
			int a = Integer.parseInt(inputs[0]);
			int b = Integer.parseInt(inputs[1]);
			int c = Integer.parseInt(inputs[2]);
			int k = Integer.parseInt(br.readLine());
			for (int i = 0; i < k; i++) {
				if (a > b && a>c) {
					a *= 2;
				} else if (b > c) {
					b *= 2;
				} else {
					c *= 2;
				}
			}
			System.out.println(a+b+c);
		}
	}
}
