import java.util.*;
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();
		sc.close();

		int ans = 0;
		List<Integer> inputList = new ArrayList<>();
		inputList.add(A);
		inputList.add(B);
		inputList.add(C);
		Collections.sort(inputList);
		ans = inputList.get(2);
		for(int i=0; i<K; i++) {
			ans *=2;
		}

		ans = ans + inputList.get(0) + inputList.get(1);

		System.out.println(ans);
	}


} import java.util.*; util.* java 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();
		sc.close();

		int ans = 0;
		List<Integer> inputList = new ArrayList<>();
		inputList.add(A);
		inputList.add(B);
		inputList.add(C);
		Collections.sort(inputList);
		ans = inputList.get(2);
		for(int i=0; i<K; i++) {
			ans *=2;
		}

		ans = ans + inputList.get(0) + inputList.get(1);

		System.out.println(ans);
	}


} 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();
		sc.close();

		int ans = 0;
		List<Integer> inputList = new ArrayList<>();
		inputList.add(A);
		inputList.add(B);
		inputList.add(C);
		Collections.sort(inputList);
		ans = inputList.get(2);
		for(int i=0; i<K; i++) {
			ans *=2;
		}

		ans = ans + inputList.get(0) + inputList.get(1);

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		int ans = 0;
		List<Integer> inputList = new ArrayList<>();
		inputList.add(A);
		inputList.add(B);
		inputList.add(C);
		Collections.sort(inputList);
		ans = inputList.get(2);
		for(int i=0; i<K; i++) {
			ans *=2;
		}

		ans = ans + inputList.get(0) + inputList.get(1);

		System.out.println(ans);
	} 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 sc.close() sc.close sc int ans = 0; ans 0 List<Integer> inputList = new ArrayList<>(); inputList new ArrayList<>() inputList.add(A) inputList.add inputList A inputList.add(B) inputList.add inputList B inputList.add(C) inputList.add inputList C Collections.sort(inputList) Collections.sort Collections inputList ans = inputList.get(2) ans inputList.get(2) inputList.get inputList 2 for(int i=0; i<K; i++) {
			ans *=2;
		} int i=0; int i=0; i 0 i<K i K i++ i++ i {
			ans *=2;
		} {
			ans *=2;
		} ans *=2 ans 2 ans = ans + inputList.get(0) + inputList.get(1) ans ans + inputList.get(0) + inputList.get(1) ans + inputList.get(0) + inputList.get(1) ans inputList.get(0) inputList.get inputList 0 inputList.get(1) inputList.get inputList 1 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 A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		int ans = 0;
		List<Integer> inputList = new ArrayList<>();
		inputList.add(A);
		inputList.add(B);
		inputList.add(C);
		Collections.sort(inputList);
		ans = inputList.get(2);
		for(int i=0; i<K; i++) {
			ans *=2;
		}

		ans = ans + inputList.get(0) + inputList.get(1);

		System.out.println(ans);
	}


} 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();
		sc.close();

		int ans = 0;
		List<Integer> inputList = new ArrayList<>();
		inputList.add(A);
		inputList.add(B);
		inputList.add(C);
		Collections.sort(inputList);
		ans = inputList.get(2);
		for(int i=0; i<K; i++) {
			ans *=2;
		}

		ans = ans + inputList.get(0) + inputList.get(1);

		System.out.println(ans);
	}


} Main
import java.util.*;
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();
		sc.close();

		int ans = 0;
		List<Integer> inputList = new ArrayList<>();
		inputList.add(A);
		inputList.add(B);
		inputList.add(C);
		Collections.sort(inputList);
		ans = inputList.get(2);
		for(int i=0; i<K; i++) {
			ans *=2;
		}

		ans = ans + inputList.get(0) + inputList.get(1);

		System.out.println(ans);
	}


}