import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = nextIntArray(sc, 3);
		int K = sc.nextInt();

		sc.close();

		Arrays.sort(a);

		a[2] = a[2] * (1 << K);

		long ans = a[0] + a[1] + a[2];
		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = nextIntArray(sc, 3);
		int K = sc.nextInt();

		sc.close();

		Arrays.sort(a);

		a[2] = a[2] * (1 << K);

		long ans = a[0] + a[1] + a[2];
		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = nextIntArray(sc, 3);
		int K = sc.nextInt();

		sc.close();

		Arrays.sort(a);

		a[2] = a[2] * (1 << K);

		long ans = a[0] + a[1] + a[2];
		out.println(ans);

	} _main {
		Scanner sc = new Scanner(in);

		int[] a = nextIntArray(sc, 3);
		int K = sc.nextInt();

		sc.close();

		Arrays.sort(a);

		a[2] = a[2] * (1 << K);

		long ans = a[0] + a[1] + a[2];
		out.println(ans);

	} Scanner sc = new Scanner(in); sc new Scanner(in) int[] a = nextIntArray(sc, 3); a nextIntArray(sc, 3) nextIntArray sc 3 int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc sc.close() sc.close sc Arrays.sort(a) Arrays.sort Arrays a a[2] = a[2] * (1 << K) a[2] a 2 a[2] * (1 << K) a[2] a 2 (1 << K) 1 K long ans = a[0] + a[1] + a[2]; ans a[0] + a[1] + a[2] a[0] + a[1] + a[2] a[0] a 0 a[1] a 1 a[2] a 2 out.println(ans) out.println out ans String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args @SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} nextIntArray {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} int[] result = new int[n]; result new int[n] n for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			result[i] = sc.nextInt();
		} {
			result[i] = sc.nextInt();
		} result[i] = sc.nextInt() result[i] result i sc.nextInt() sc.nextInt sc return result; result Scanner sc sc int n n public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = nextIntArray(sc, 3);
		int K = sc.nextInt();

		sc.close();

		Arrays.sort(a);

		a[2] = a[2] * (1 << K);

		long ans = a[0] + a[1] + a[2];
		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = nextIntArray(sc, 3);
		int K = sc.nextInt();

		sc.close();

		Arrays.sort(a);

		a[2] = a[2] * (1 << K);

		long ans = a[0] + a[1] + a[2];
		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int[] a = nextIntArray(sc, 3);
		int K = sc.nextInt();

		sc.close();

		Arrays.sort(a);

		a[2] = a[2] * (1 << K);

		long ans = a[0] + a[1] + a[2];
		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
}
