import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abc = new int[3];
		for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		}
		Arrays.sort(abc);

		int k = sc.nextInt();

		abc[2] <<= k;

		pr.println(abc[2] + abc[1] + abc[0]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abc = new int[3];
		for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		}
		Arrays.sort(abc);

		int k = sc.nextInt();

		abc[2] <<= k;

		pr.println(abc[2] + abc[1] + abc[0]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr static String INPUT = null; INPUT null private static void solve() {
		int[] abc = new int[3];
		for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		}
		Arrays.sort(abc);

		int k = sc.nextInt();

		abc[2] <<= k;

		pr.println(abc[2] + abc[1] + abc[0]);
	} solve {
		int[] abc = new int[3];
		for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		}
		Arrays.sort(abc);

		int k = sc.nextInt();

		abc[2] <<= k;

		pr.println(abc[2] + abc[1] + abc[0]);
	} int[] abc = new int[3]; abc new int[3] 3 for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			abc[i] = sc.nextInt();
		} {
			abc[i] = sc.nextInt();
		} abc[i] = sc.nextInt() abc[i] abc i sc.nextInt() sc.nextInt sc Arrays.sort(abc) Arrays.sort Arrays abc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc abc[2] <<= k abc[2] abc 2 k pr.println(abc[2] + abc[1] + abc[0]) pr.println pr abc[2] + abc[1] + abc[0] abc[2] + abc[1] + abc[0] abc[2] abc 2 abc[1] abc 1 abc[0] abc 0 // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	} main {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	} sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())) sc new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.flush() pr.flush pr String[] args args private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	} Printer Printer(OutputStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out OutputStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abc = new int[3];
		for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		}
		Arrays.sort(abc);

		int k = sc.nextInt();

		abc[2] <<= k;

		pr.println(abc[2] + abc[1] + abc[0]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abc = new int[3];
		for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		}
		Arrays.sort(abc);

		int k = sc.nextInt();

		abc[2] <<= k;

		pr.println(abc[2] + abc[1] + abc[0]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int[] abc = new int[3];
		for (int i = 0; i < 3; i++) {
			abc[i] = sc.nextInt();
		}
		Arrays.sort(abc);

		int k = sc.nextInt();

		abc[2] <<= k;

		pr.println(abc[2] + abc[1] + abc[0]);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
