import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();

		int max = a;
		String str = "a";
		if (max < b) {
			max = b;
			str = "b";
		}
		if (max < c) {
			max = c;
			str = "c";
		}

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

		if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		}

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();

		int max = a;
		String str = "a";
		if (max < b) {
			max = b;
			str = "b";
		}
		if (max < c) {
			max = c;
			str = "c";
		}

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

		if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		}

	}

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();

		int max = a;
		String str = "a";
		if (max < b) {
			max = b;
			str = "b";
		}
		if (max < c) {
			max = c;
			str = "c";
		}

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

		if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		}

	} main {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();

		int max = a;
		String str = "a";
		if (max < b) {
			max = b;
			str = "b";
		}
		if (max < c) {
			max = c;
			str = "c";
		}

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

		if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int max = a; max a String str = "a"; str "a" if (max < b) {
			max = b;
			str = "b";
		} max < b max b {
			max = b;
			str = "b";
		} max = b max b str = "b" str "b" if (max < c) {
			max = c;
			str = "c";
		} max < c max c {
			max = c;
			str = "c";
		} max = c max c str = "c" str "c" for (int i = 0; i < k; i++) {
			max = max * 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			max = max * 2;
		} {
			max = max * 2;
		} max = max * 2 max max * 2 max 2 if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		} str.equals("a") str.equals str "a" {
			System.out.print(max + b + c);
		} System.out.print(max + b + c) System.out.print System.out System System.out max + b + c max + b + c max b c if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		} str.equals("b") str.equals str "b" {
			System.out.print(a + max + c);
		} System.out.print(a + max + c) System.out.print System.out System System.out a + max + c a + max + c a max c {
			System.out.print(a + b + max);
		} System.out.print(a + b + max) System.out.print System.out System System.out a + b + max a + b + max a b max String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();

		int max = a;
		String str = "a";
		if (max < b) {
			max = b;
			str = "b";
		}
		if (max < c) {
			max = c;
			str = "c";
		}

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

		if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		}

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();

		int max = a;
		String str = "a";
		if (max < b) {
			max = b;
			str = "b";
		}
		if (max < c) {
			max = c;
			str = "c";
		}

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

		if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();

		int max = a;
		String str = "a";
		if (max < b) {
			max = b;
			str = "b";
		}
		if (max < c) {
			max = c;
			str = "c";
		}

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

		if (str.equals("a")) {
			System.out.print(max + b + c);
		} else if (str.equals("b")) {
			System.out.print(a + max + c);
		} else {
			System.out.print(a + b + max);
		}

	}

}
