

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

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

		int max = Math.max(a, Math.max(b, c));

		if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		}
	}

} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

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

		int max = Math.max(a, Math.max(b, c));

		if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

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

		int max = Math.max(a, Math.max(b, c));

		if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

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

		int max = Math.max(a, Math.max(b, c));

		if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k2 = 1; k2 1 for (int i = 0; i < k; i++) {
			k2 *= 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			k2 *= 2;
		} {
			k2 *= 2;
		} k2 *= 2 k2 2 int max = Math.max(a, Math.max(b, c)); max Math.max(a, Math.max(b, c)) Math.max Math a Math.max(b, c) Math.max Math b c if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		} max == a max a {
			System.out.println(a * k2 + b + c);
		} System.out.println(a * k2 + b + c) System.out.println System.out System System.out a * k2 + b + c a * k2 + b + c a * k2 a k2 b c if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		} max == b max b {
			System.out.println(a + b * k2 + c);
		} System.out.println(a + b * k2 + c) System.out.println System.out System System.out a + b * k2 + c a + b * k2 + c a b * k2 b k2 c {
			System.out.println(a + b + c * k2);
		} System.out.println(a + b + c * k2) System.out.println System.out System System.out a + b + c * k2 a + b + c * k2 a b c * k2 c k2 String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

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

		int max = Math.max(a, Math.max(b, c));

		if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		}
	}

} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

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

		int max = Math.max(a, Math.max(b, c));

		if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		}
	}

} Main


import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());

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

		int max = Math.max(a, Math.max(b, c));

		if (max == a) {
			System.out.println(a * k2 + b + c);
		} else if (max == b) {
			System.out.println(a + b * k2 + c);
		} else {
			System.out.println(a + b + c * k2);
		}
	}

}
