import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		// 計算
		int result = 0;
		int max = max(a, max(b, c));
		result = a + b + c + (int)(max*(pow(2, k) -1));
		

		// 出力
		System.out.println(result);
	}
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import java.math.BigInteger; BigInteger java.math public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		// 計算
		int result = 0;
		int max = max(a, max(b, c));
		result = a + b + c + (int)(max*(pow(2, k) -1));
		

		// 出力
		System.out.println(result);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		// 計算
		int result = 0;
		int max = max(a, max(b, c));
		result = a + b + c + (int)(max*(pow(2, k) -1));
		

		// 出力
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		// 計算
		int result = 0;
		int max = max(a, max(b, c));
		result = a + b + c + (int)(max*(pow(2, k) -1));
		

		// 出力
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int result = 0; result 0 int max = max(a, max(b, c)); max max(a, max(b, c)) max a max(b, c) max b c result = a + b + c + (int)(max*(pow(2, k) -1)) result a + b + c + (int)(max*(pow(2, k) -1)) c a + b + c + (int)(max*(pow(2, k) -1)) a b c (int)(max*(pow(2, k) -1)) max (pow(2, k) -1) pow(2, k) pow 2 k 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		// 計算
		int result = 0;
		int max = max(a, max(b, c));
		result = a + b + c + (int)(max*(pow(2, k) -1));
		

		// 出力
		System.out.println(result);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		// 計算
		int result = 0;
		int max = max(a, max(b, c));
		result = a + b + c + (int)(max*(pow(2, k) -1));
		

		// 出力
		System.out.println(result);
	}
} Main
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		// 計算
		int result = 0;
		int max = max(a, max(b, c));
		result = a + b + c + (int)(max*(pow(2, k) -1));
		

		// 出力
		System.out.println(result);
	}
}
