import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		int mx = Math.max(a, Math.max(b, c));
		out.println(a+b+c+mx*((int)pow(2, k)-1));
	}
} import java.util.*; util.* java import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		int mx = Math.max(a, Math.max(b, c));
		out.println(a+b+c+mx*((int)pow(2, k)-1));
	}
} Main public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		int mx = Math.max(a, Math.max(b, c));
		out.println(a+b+c+mx*((int)pow(2, k)-1));
	} main {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		int mx = Math.max(a, Math.max(b, c));
		out.println(a+b+c+mx*((int)pow(2, k)-1));
	} int i i j; j Scanner sc = new Scanner(in); sc new Scanner(in) int a = parseInt(sc.next()); a parseInt(sc.next()) parseInt sc.next() sc.next sc int b = parseInt(sc.next()); b parseInt(sc.next()) parseInt sc.next() sc.next sc int c = parseInt(sc.next()); c parseInt(sc.next()) parseInt sc.next() sc.next sc int k = parseInt(sc.next()); k parseInt(sc.next()) parseInt sc.next() sc.next sc sc.close() sc.close sc int mx = Math.max(a, Math.max(b, c)); mx Math.max(a, Math.max(b, c)) Math.max Math a Math.max(b, c) Math.max Math b c out.println(a+b+c+mx*((int)pow(2, k)-1)) out.println out a+b+c+mx*((int)pow(2, k)-1) c a+b+c+mx*((int)pow(2, k)-1) a b c mx*((int)pow(2, k)-1) mx ((int)pow(2, k)-1) (int)pow(2, k) pow 2 k 1 String[] args args public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		int mx = Math.max(a, Math.max(b, c));
		out.println(a+b+c+mx*((int)pow(2, k)-1));
	}
} public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		int mx = Math.max(a, Math.max(b, c));
		out.println(a+b+c+mx*((int)pow(2, k)-1));
	}
} Main
import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		int c = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		int mx = Math.max(a, Math.max(b, c));
		out.println(a+b+c+mx*((int)pow(2, k)-1));
	}
}
