import java.util.Arrays;
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int k = scanner.nextInt();
		int abc[] = new int[3];

		abc[0] = a;
		abc[1] = b;
		abc[2] = c;
		Arrays.sort(abc);

		for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		}

		int sum = 0;
		for (int i = 0; i < 3; i++) {
			sum += abc[i];
		}

		System.out.println(sum);

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

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int k = scanner.nextInt();
		int abc[] = new int[3];

		abc[0] = a;
		abc[1] = b;
		abc[2] = c;
		Arrays.sort(abc);

		for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		}

		int sum = 0;
		for (int i = 0; i < 3; i++) {
			sum += abc[i];
		}

		System.out.println(sum);

	}
} Main @SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int k = scanner.nextInt();
		int abc[] = new int[3];

		abc[0] = a;
		abc[1] = b;
		abc[2] = c;
		Arrays.sort(abc);

		for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		}

		int sum = 0;
		for (int i = 0; i < 3; i++) {
			sum += abc[i];
		}

		System.out.println(sum);

	} main {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int k = scanner.nextInt();
		int abc[] = new int[3];

		abc[0] = a;
		abc[1] = b;
		abc[2] = c;
		Arrays.sort(abc);

		for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		}

		int sum = 0;
		for (int i = 0; i < 3; i++) {
			sum += abc[i];
		}

		System.out.println(sum);

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int c = scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner int abc[] = new int[3]; abc new int[3] 3 abc[0] = a abc[0] abc 0 a abc[1] = b abc[1] abc 1 b abc[2] = c abc[2] abc 2 c Arrays.sort(abc) Arrays.sort Arrays abc for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			abc[2] *= 2;
		} {
			abc[2] *= 2;
		} abc[2] *= 2 abc[2] abc 2 2 int sum = 0; sum 0 for (int i = 0; i < 3; i++) {
			sum += abc[i];
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			sum += abc[i];
		} {
			sum += abc[i];
		} sum += abc[i] sum abc[i] abc i System.out.println(sum) System.out.println System.out System System.out sum String args[] args public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int k = scanner.nextInt();
		int abc[] = new int[3];

		abc[0] = a;
		abc[1] = b;
		abc[2] = c;
		Arrays.sort(abc);

		for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		}

		int sum = 0;
		for (int i = 0; i < 3; i++) {
			sum += abc[i];
		}

		System.out.println(sum);

	}
} public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int k = scanner.nextInt();
		int abc[] = new int[3];

		abc[0] = a;
		abc[1] = b;
		abc[2] = c;
		Arrays.sort(abc);

		for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		}

		int sum = 0;
		for (int i = 0; i < 3; i++) {
			sum += abc[i];
		}

		System.out.println(sum);

	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int k = scanner.nextInt();
		int abc[] = new int[3];

		abc[0] = a;
		abc[1] = b;
		abc[2] = c;
		Arrays.sort(abc);

		for (int i = 0; i < k; i++) {
			abc[2] *= 2;
		}

		int sum = 0;
		for (int i = 0; i < 3; i++) {
			sum += abc[i];
		}

		System.out.println(sum);

	}
}
