import static java.lang.System.*;
import java.util.*;
 
public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(), k=sc.nextInt();
		int total = a+b+c;
		int max = max(a,b,c);
		int pow = (int)Math.pow(2,k);
		out.println((total-max)+max*pow);
	}
	
	static int max(int... ar) {
		Arrays.sort(ar);
		return ar[ar.length-1];
	}
} import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; import java.util.*; util.* java public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(), k=sc.nextInt();
		int total = a+b+c;
		int max = max(a,b,c);
		int pow = (int)Math.pow(2,k);
		out.println((total-max)+max*pow);
	}
	
	static int max(int... ar) {
		Arrays.sort(ar);
		return ar[ar.length-1];
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(), k=sc.nextInt();
		int total = a+b+c;
		int max = max(a,b,c);
		int pow = (int)Math.pow(2,k);
		out.println((total-max)+max*pow);
	} main {
		int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(), k=sc.nextInt();
		int total = a+b+c;
		int max = max(a,b,c);
		int pow = (int)Math.pow(2,k);
		out.println((total-max)+max*pow);
	} int a=sc.nextInt() a sc.nextInt() sc.nextInt sc b=sc.nextInt() b sc.nextInt() sc.nextInt sc c=sc.nextInt() c sc.nextInt() sc.nextInt sc k=sc.nextInt(); k sc.nextInt() sc.nextInt sc int total = a+b+c; total a+b+c a+b+c a b c int max = max(a,b,c); max max(a,b,c) max a b c int pow = (int)Math.pow(2,k); pow (int)Math.pow(2,k) Math.pow Math 2 k out.println((total-max)+max*pow) out.println out (total-max)+max*pow (total-max) total max max*pow max pow String[] args args static int max(int... ar) {
		Arrays.sort(ar);
		return ar[ar.length-1];
	} max {
		Arrays.sort(ar);
		return ar[ar.length-1];
	} Arrays.sort(ar) Arrays.sort Arrays ar return ar[ar.length-1]; ar[ar.length-1] ar ar.length-1 ar.length ar ar.length 1 int... ar ar public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(), k=sc.nextInt();
		int total = a+b+c;
		int max = max(a,b,c);
		int pow = (int)Math.pow(2,k);
		out.println((total-max)+max*pow);
	}
	
	static int max(int... ar) {
		Arrays.sort(ar);
		return ar[ar.length-1];
	}
} public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(), k=sc.nextInt();
		int total = a+b+c;
		int max = max(a,b,c);
		int pow = (int)Math.pow(2,k);
		out.println((total-max)+max*pow);
	}
	
	static int max(int... ar) {
		Arrays.sort(ar);
		return ar[ar.length-1];
	}
} Main
import static java.lang.System.*;
import java.util.*;
 
public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(), k=sc.nextInt();
		int total = a+b+c;
		int max = max(a,b,c);
		int pow = (int)Math.pow(2,k);
		out.println((total-max)+max*pow);
	}
	
	static int max(int... ar) {
		Arrays.sort(ar);
		return ar[ar.length-1];
	}
}