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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		
		Arrays.sort(num);
		int ans = num[0] + num[1] + (num[2]<<K);
		System.out.println(ans);
	}
} 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[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		
		Arrays.sort(num);
		int ans = num[0] + num[1] + (num[2]<<K);
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		
		Arrays.sort(num);
		int ans = num[0] + num[1] + (num[2]<<K);
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		
		Arrays.sort(num);
		int ans = num[0] + num[1] + (num[2]<<K);
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] num = new int[3]; num new int[3] 3 for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i num[i] = sc.nextInt(); num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc sc.close() sc.close sc Arrays.sort(num) Arrays.sort Arrays num int ans = num[0] + num[1] + (num[2]<<K); ans num[0] + num[1] + (num[2]<<K) num[0] + num[1] + (num[2]<<K) num[0] num 0 num[1] num 1 (num[2]<<K) num[2] num 2 K System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		
		Arrays.sort(num);
		int ans = num[0] + num[1] + (num[2]<<K);
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		
		Arrays.sort(num);
		int ans = num[0] + num[1] + (num[2]<<K);
		System.out.println(ans);
	}
} 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[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		
		Arrays.sort(num);
		int ans = num[0] + num[1] + (num[2]<<K);
		System.out.println(ans);
	}
}
