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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] x = new int[3];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		int K = sc.nextInt();

		Arrays.sort(x);
		for (int i = 0; i < K; i++) {
			x[2] *= 2;
		}

		int sum = 0;
		for (int a : x) {
			sum += a;
		}

		System.out.println(sum);

	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] x = new int[3];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		int K = sc.nextInt();

		Arrays.sort(x);
		for (int i = 0; i < K; i++) {
			x[2] *= 2;
		}

		int sum = 0;
		for (int a : x) {
			sum += a;
		}

		System.out.println(sum);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] x = new int[3];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		int K = sc.nextInt();

		Arrays.sort(x);
		for (int i = 0; i < K; i++) {
			x[2] *= 2;
		}

		int sum = 0;
		for (int a : x) {
			sum += a;
		}

		System.out.println(sum);

	} main {
		Scanner sc = new Scanner(System.in);
		int[] x = new int[3];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		int K = sc.nextInt();

		Arrays.sort(x);
		for (int i = 0; i < K; i++) {
			x[2] *= 2;
		}

		int sum = 0;
		for (int a : x) {
			sum += a;
		}

		System.out.println(sum);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] x = new int[3]; x new int[3] 3 for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < x.length i x.length x x.length i++ i++ i {
			x[i] = sc.nextInt();
		} {
			x[i] = sc.nextInt();
		} x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc Arrays.sort(x) Arrays.sort Arrays x for (int i = 0; i < K; i++) {
			x[2] *= 2;
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			x[2] *= 2;
		} {
			x[2] *= 2;
		} x[2] *= 2 x[2] x 2 2 int sum = 0; sum 0 for (int a : x) {
			sum += a;
		} int a x {
			sum += a;
		} {
			sum += a;
		} sum += a sum a System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] x = new int[3];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		int K = sc.nextInt();

		Arrays.sort(x);
		for (int i = 0; i < K; i++) {
			x[2] *= 2;
		}

		int sum = 0;
		for (int a : x) {
			sum += a;
		}

		System.out.println(sum);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] x = new int[3];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		int K = sc.nextInt();

		Arrays.sort(x);
		for (int i = 0; i < K; i++) {
			x[2] *= 2;
		}

		int sum = 0;
		for (int a : x) {
			sum += a;
		}

		System.out.println(sum);

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] x = new int[3];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		int K = sc.nextInt();

		Arrays.sort(x);
		for (int i = 0; i < K; i++) {
			x[2] *= 2;
		}

		int sum = 0;
		for (int a : x) {
			sum += a;
		}

		System.out.println(sum);

	}
}