import java.util.*;
import java.util.regex.*;

public class Main {
	
	public static void main(String... args) {
		System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt()));
	}
	
	private static int sum(int[] nums, int K) {
		int m = nums[nums.length - 1];
		int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1);
		int t = m;
		for (int i = 0; i < K; ++i) {
			t *= 2;
		}
		for (int n : nnn) {
			t += n;
		}
		return t;
	}
	
	private static int[] sort(int... a) {
		Arrays.sort(a);
		return a;
	}
	
	private static final Scanner SC = new Scanner(System.in);

	private static int scanInt() {
		return SC.nextInt();
	}

	private static  String scanString() {
		return SC.next();
	}
} import java.util.*; util.* java import java.util.regex.*; regex.* java.util public class Main {
	
	public static void main(String... args) {
		System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt()));
	}
	
	private static int sum(int[] nums, int K) {
		int m = nums[nums.length - 1];
		int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1);
		int t = m;
		for (int i = 0; i < K; ++i) {
			t *= 2;
		}
		for (int n : nnn) {
			t += n;
		}
		return t;
	}
	
	private static int[] sort(int... a) {
		Arrays.sort(a);
		return a;
	}
	
	private static final Scanner SC = new Scanner(System.in);

	private static int scanInt() {
		return SC.nextInt();
	}

	private static  String scanString() {
		return SC.next();
	}
} Main private static final Scanner SC = new Scanner(System.in); SC new Scanner(System.in) public static void main(String... args) {
		System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt()));
	} main {
		System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt()));
	} System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt())) System.out.println System.out System System.out sum(sort(scanInt(), scanInt(), scanInt()), scanInt()) sum sort(scanInt(), scanInt(), scanInt()) sort scanInt() scanInt scanInt() scanInt scanInt() scanInt scanInt() scanInt String... args args private static int sum(int[] nums, int K) {
		int m = nums[nums.length - 1];
		int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1);
		int t = m;
		for (int i = 0; i < K; ++i) {
			t *= 2;
		}
		for (int n : nnn) {
			t += n;
		}
		return t;
	} sum {
		int m = nums[nums.length - 1];
		int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1);
		int t = m;
		for (int i = 0; i < K; ++i) {
			t *= 2;
		}
		for (int n : nnn) {
			t += n;
		}
		return t;
	} int m = nums[nums.length - 1]; m nums[nums.length - 1] nums nums.length - 1 nums.length nums nums.length 1 int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1); nnn Arrays.copyOfRange(nums, 0, nums.length - 1) Arrays.copyOfRange Arrays nums 0 nums.length - 1 nums.length nums nums.length 1 int t = m; t m for (int i = 0; i < K; ++i) {
			t *= 2;
		} int i = 0; int i = 0; i 0 i < K i K ++i ++i i {
			t *= 2;
		} {
			t *= 2;
		} t *= 2 t 2 for (int n : nnn) {
			t += n;
		} int n nnn {
			t += n;
		} {
			t += n;
		} t += n t n return t; t int[] nums nums int K K private static int[] sort(int... a) {
		Arrays.sort(a);
		return a;
	} sort {
		Arrays.sort(a);
		return a;
	} Arrays.sort(a) Arrays.sort Arrays a return a; a int... a a private static int scanInt() {
		return SC.nextInt();
	} scanInt {
		return SC.nextInt();
	} return SC.nextInt(); SC.nextInt() SC.nextInt SC private static  String scanString() {
		return SC.next();
	} scanString {
		return SC.next();
	} return SC.next(); SC.next() SC.next SC public class Main {
	
	public static void main(String... args) {
		System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt()));
	}
	
	private static int sum(int[] nums, int K) {
		int m = nums[nums.length - 1];
		int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1);
		int t = m;
		for (int i = 0; i < K; ++i) {
			t *= 2;
		}
		for (int n : nnn) {
			t += n;
		}
		return t;
	}
	
	private static int[] sort(int... a) {
		Arrays.sort(a);
		return a;
	}
	
	private static final Scanner SC = new Scanner(System.in);

	private static int scanInt() {
		return SC.nextInt();
	}

	private static  String scanString() {
		return SC.next();
	}
} public class Main {
	
	public static void main(String... args) {
		System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt()));
	}
	
	private static int sum(int[] nums, int K) {
		int m = nums[nums.length - 1];
		int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1);
		int t = m;
		for (int i = 0; i < K; ++i) {
			t *= 2;
		}
		for (int n : nnn) {
			t += n;
		}
		return t;
	}
	
	private static int[] sort(int... a) {
		Arrays.sort(a);
		return a;
	}
	
	private static final Scanner SC = new Scanner(System.in);

	private static int scanInt() {
		return SC.nextInt();
	}

	private static  String scanString() {
		return SC.next();
	}
} Main
import java.util.*;
import java.util.regex.*;

public class Main {
	
	public static void main(String... args) {
		System.out.println(sum(sort(scanInt(), scanInt(), scanInt()), scanInt()));
	}
	
	private static int sum(int[] nums, int K) {
		int m = nums[nums.length - 1];
		int[] nnn = Arrays.copyOfRange(nums, 0, nums.length - 1);
		int t = m;
		for (int i = 0; i < K; ++i) {
			t *= 2;
		}
		for (int n : nnn) {
			t += n;
		}
		return t;
	}
	
	private static int[] sort(int... a) {
		Arrays.sort(a);
		return a;
	}
	
	private static final Scanner SC = new Scanner(System.in);

	private static int scanInt() {
		return SC.nextInt();
	}

	private static  String scanString() {
		return SC.next();
	}
}
