import java.util.*;
import java.io.*;

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();

		if(a < b){
			int temp = a;
			a = b;
			b = temp;
		}

		if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		}

		int maxSum = a;
		for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		}

		maxSum += b;
		maxSum += c;

		System.out.println(maxSum);
		
	}
} import java.util.*; util.* java import java.io.*; io.* 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();

		if(a < b){
			int temp = a;
			a = b;
			b = temp;
		}

		if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		}

		int maxSum = a;
		for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		}

		maxSum += b;
		maxSum += c;

		System.out.println(maxSum);
		
	}
} 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();

		if(a < b){
			int temp = a;
			a = b;
			b = temp;
		}

		if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		}

		int maxSum = a;
		for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		}

		maxSum += b;
		maxSum += c;

		System.out.println(maxSum);
		
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		int k = sc.nextInt();

		if(a < b){
			int temp = a;
			a = b;
			b = temp;
		}

		if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		}

		int maxSum = a;
		for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		}

		maxSum += b;
		maxSum += c;

		System.out.println(maxSum);
		
	} 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 if(a < b){
			int temp = a;
			a = b;
			b = temp;
		} a < b a b {
			int temp = a;
			a = b;
			b = temp;
		} int temp = a; temp a a = b a b b = temp b temp if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		} a < c a c {
			int temp = a;
			a = c;
			c = temp;	
		} int temp = a; temp a a = c a c c = temp c temp int maxSum = a; maxSum a for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		} int i=1; int i=1; i 1 i<=k i k i++ i++ i {
			maxSum = maxSum * 2;
		} {
			maxSum = maxSum * 2;
		} maxSum = maxSum * 2 maxSum maxSum * 2 maxSum 2 maxSum += b maxSum b maxSum += c maxSum c System.out.println(maxSum) System.out.println System.out System System.out maxSum 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();

		if(a < b){
			int temp = a;
			a = b;
			b = temp;
		}

		if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		}

		int maxSum = a;
		for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		}

		maxSum += b;
		maxSum += c;

		System.out.println(maxSum);
		
	}
} 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();

		if(a < b){
			int temp = a;
			a = b;
			b = temp;
		}

		if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		}

		int maxSum = a;
		for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		}

		maxSum += b;
		maxSum += c;

		System.out.println(maxSum);
		
	}
} Main
import java.util.*;
import java.io.*;

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();

		if(a < b){
			int temp = a;
			a = b;
			b = temp;
		}

		if(a < c){
			int temp = a;
			a = c;
			c = temp;	
		}

		int maxSum = a;
		for(int i=1; i<=k; i++){
			maxSum = maxSum * 2;
		}

		maxSum += b;
		maxSum += c;

		System.out.println(maxSum);
		
	}
}
