import java.util.Scanner;

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

		int max = 1;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		}
		sum -= max;

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

		System.out.println(sum + max);

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

		int max = 1;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		}
		sum -= max;

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

		System.out.println(sum + max);

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

		int max = 1;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		}
		sum -= max;

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

		System.out.println(sum + max);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int max = 1;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		}
		sum -= max;

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

		System.out.println(sum + max);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int max = 1; max 1 int sum = 0; sum 0 for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		} {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		} int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc sum += tmp sum tmp if (tmp > max) {
				max = tmp;
			} tmp > max tmp max {
				max = tmp;
			} max = tmp max tmp sum -= max sum max int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc 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(sum + max) System.out.println System.out System System.out sum + max sum max sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int max = 1;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		}
		sum -= max;

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

		System.out.println(sum + max);

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

		int max = 1;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		}
		sum -= max;

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

		System.out.println(sum + max);

		sc.close();
	}
} Main
import java.util.Scanner;

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

		int max = 1;
		int sum = 0;
		for (int i = 0; i < 3; i++) {
			int tmp = sc.nextInt();
			sum += tmp;
			if (tmp > max) {
				max = tmp;
			}
		}
		sum -= max;

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

		System.out.println(sum + max);

		sc.close();
	}
}
