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

public class Main {

	public static void main(String[] args) throws UnsupportedEncodingException {

		Scanner sc = new Scanner(System.in);

		int ans = 0;

		int[] list = new int[3];
		list[0] = sc.nextInt();
		list[1] = sc.nextInt();
		list[2] = sc.nextInt();

		int K = sc.nextInt();

		Arrays.sort(list);

		for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		}

		for (int i : list) {
			ans += i;
		}

		System.out.println(ans);
		sc.close();
	}
} import java.io.UnsupportedEncodingException; UnsupportedEncodingException java.io import java.util.*; util.* java public class Main {

	public static void main(String[] args) throws UnsupportedEncodingException {

		Scanner sc = new Scanner(System.in);

		int ans = 0;

		int[] list = new int[3];
		list[0] = sc.nextInt();
		list[1] = sc.nextInt();
		list[2] = sc.nextInt();

		int K = sc.nextInt();

		Arrays.sort(list);

		for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		}

		for (int i : list) {
			ans += i;
		}

		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) throws UnsupportedEncodingException {

		Scanner sc = new Scanner(System.in);

		int ans = 0;

		int[] list = new int[3];
		list[0] = sc.nextInt();
		list[1] = sc.nextInt();
		list[2] = sc.nextInt();

		int K = sc.nextInt();

		Arrays.sort(list);

		for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		}

		for (int i : list) {
			ans += i;
		}

		System.out.println(ans);
		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);

		int ans = 0;

		int[] list = new int[3];
		list[0] = sc.nextInt();
		list[1] = sc.nextInt();
		list[2] = sc.nextInt();

		int K = sc.nextInt();

		Arrays.sort(list);

		for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		}

		for (int i : list) {
			ans += i;
		}

		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ans = 0; ans 0 int[] list = new int[3]; list new int[3] 3 list[0] = sc.nextInt() list[0] list 0 sc.nextInt() sc.nextInt sc list[1] = sc.nextInt() list[1] list 1 sc.nextInt() sc.nextInt sc list[2] = sc.nextInt() list[2] list 2 sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc Arrays.sort(list) Arrays.sort Arrays list for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			list[2] = list[2] * 2;

		} {
			list[2] = list[2] * 2;

		} list[2] = list[2] * 2 list[2] list 2 list[2] * 2 list[2] list 2 2 for (int i : list) {
			ans += i;
		} int i list {
			ans += i;
		} {
			ans += i;
		} ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws UnsupportedEncodingException {

		Scanner sc = new Scanner(System.in);

		int ans = 0;

		int[] list = new int[3];
		list[0] = sc.nextInt();
		list[1] = sc.nextInt();
		list[2] = sc.nextInt();

		int K = sc.nextInt();

		Arrays.sort(list);

		for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		}

		for (int i : list) {
			ans += i;
		}

		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws UnsupportedEncodingException {

		Scanner sc = new Scanner(System.in);

		int ans = 0;

		int[] list = new int[3];
		list[0] = sc.nextInt();
		list[1] = sc.nextInt();
		list[2] = sc.nextInt();

		int K = sc.nextInt();

		Arrays.sort(list);

		for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		}

		for (int i : list) {
			ans += i;
		}

		System.out.println(ans);
		sc.close();
	}
} Main
import java.io.UnsupportedEncodingException;
import java.util.*;

public class Main {

	public static void main(String[] args) throws UnsupportedEncodingException {

		Scanner sc = new Scanner(System.in);

		int ans = 0;

		int[] list = new int[3];
		list[0] = sc.nextInt();
		list[1] = sc.nextInt();
		list[2] = sc.nextInt();

		int K = sc.nextInt();

		Arrays.sort(list);

		for (int i = 0; i < K; i++) {
			list[2] = list[2] * 2;

		}

		for (int i : list) {
			ans += i;
		}

		System.out.println(ans);
		sc.close();
	}
}
