import java.util.*;

public class Main {

	public static void main(String[] args) {
		// greedy algorithm
		Scanner sc = new Scanner(System.in);

		int max;
		int a = sc.nextInt();
		max = a;

		int b = sc.nextInt();
		if (b > max)
			max = b;

		int c = sc.nextInt();
		if (c > max)
			max = c;
		int k = sc.nextInt();


	int result = 0;
	
	if(max==a) result = (int) (b+c+a*Math.pow(2, k));
	if(max==b) result = (int) (a+c+b*Math.pow(2, k));
	if(max==c) result = (int) (b+a+c*Math.pow(2, k));
		

		
		System.out.println(result);

	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// greedy algorithm
		Scanner sc = new Scanner(System.in);

		int max;
		int a = sc.nextInt();
		max = a;

		int b = sc.nextInt();
		if (b > max)
			max = b;

		int c = sc.nextInt();
		if (c > max)
			max = c;
		int k = sc.nextInt();


	int result = 0;
	
	if(max==a) result = (int) (b+c+a*Math.pow(2, k));
	if(max==b) result = (int) (a+c+b*Math.pow(2, k));
	if(max==c) result = (int) (b+a+c*Math.pow(2, k));
		

		
		System.out.println(result);

	}
} Main public static void main(String[] args) {
		// greedy algorithm
		Scanner sc = new Scanner(System.in);

		int max;
		int a = sc.nextInt();
		max = a;

		int b = sc.nextInt();
		if (b > max)
			max = b;

		int c = sc.nextInt();
		if (c > max)
			max = c;
		int k = sc.nextInt();


	int result = 0;
	
	if(max==a) result = (int) (b+c+a*Math.pow(2, k));
	if(max==b) result = (int) (a+c+b*Math.pow(2, k));
	if(max==c) result = (int) (b+a+c*Math.pow(2, k));
		

		
		System.out.println(result);

	} main {
		// greedy algorithm
		Scanner sc = new Scanner(System.in);

		int max;
		int a = sc.nextInt();
		max = a;

		int b = sc.nextInt();
		if (b > max)
			max = b;

		int c = sc.nextInt();
		if (c > max)
			max = c;
		int k = sc.nextInt();


	int result = 0;
	
	if(max==a) result = (int) (b+c+a*Math.pow(2, k));
	if(max==b) result = (int) (a+c+b*Math.pow(2, k));
	if(max==c) result = (int) (b+a+c*Math.pow(2, k));
		

		
		System.out.println(result);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int max; max int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc max = a max a int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc if (b > max)
			max = b; b > max b max max = b max b int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc if (c > max)
			max = c; c > max c max max = c max c int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int result = 0; result 0 if(max==a) result = (int) (b+c+a*Math.pow(2, k)); max==a max a result = (int) (b+c+a*Math.pow(2, k)) result (int) (b+c+a*Math.pow(2, k)) b+c+a*Math.pow(2, k) b c a*Math.pow(2, k) a Math.pow(2, k) Math.pow Math 2 k if(max==b) result = (int) (a+c+b*Math.pow(2, k)); max==b max b result = (int) (a+c+b*Math.pow(2, k)) result (int) (a+c+b*Math.pow(2, k)) a+c+b*Math.pow(2, k) a c b*Math.pow(2, k) b Math.pow(2, k) Math.pow Math 2 k if(max==c) result = (int) (b+a+c*Math.pow(2, k)); max==c max c result = (int) (b+a+c*Math.pow(2, k)) result (int) (b+a+c*Math.pow(2, k)) b+a+c*Math.pow(2, k) b a c*Math.pow(2, k) c Math.pow(2, k) Math.pow Math 2 k 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) {
		// greedy algorithm
		Scanner sc = new Scanner(System.in);

		int max;
		int a = sc.nextInt();
		max = a;

		int b = sc.nextInt();
		if (b > max)
			max = b;

		int c = sc.nextInt();
		if (c > max)
			max = c;
		int k = sc.nextInt();


	int result = 0;
	
	if(max==a) result = (int) (b+c+a*Math.pow(2, k));
	if(max==b) result = (int) (a+c+b*Math.pow(2, k));
	if(max==c) result = (int) (b+a+c*Math.pow(2, k));
		

		
		System.out.println(result);

	}
} public class Main {

	public static void main(String[] args) {
		// greedy algorithm
		Scanner sc = new Scanner(System.in);

		int max;
		int a = sc.nextInt();
		max = a;

		int b = sc.nextInt();
		if (b > max)
			max = b;

		int c = sc.nextInt();
		if (c > max)
			max = c;
		int k = sc.nextInt();


	int result = 0;
	
	if(max==a) result = (int) (b+c+a*Math.pow(2, k));
	if(max==b) result = (int) (a+c+b*Math.pow(2, k));
	if(max==c) result = (int) (b+a+c*Math.pow(2, k));
		

		
		System.out.println(result);

	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// greedy algorithm
		Scanner sc = new Scanner(System.in);

		int max;
		int a = sc.nextInt();
		max = a;

		int b = sc.nextInt();
		if (b > max)
			max = b;

		int c = sc.nextInt();
		if (c > max)
			max = c;
		int k = sc.nextInt();


	int result = 0;
	
	if(max==a) result = (int) (b+c+a*Math.pow(2, k));
	if(max==b) result = (int) (a+c+b*Math.pow(2, k));
	if(max==c) result = (int) (b+a+c*Math.pow(2, k));
		

		
		System.out.println(result);

	}
}
