import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	int x = sc.nextInt();
    	int d = 0;
    	
    	if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x);
    	System.out.println(d);
	}

} import java.io.File; File java.io import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws IOException {
		
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	int x = sc.nextInt();
    	int d = 0;
    	
    	if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x);
    	System.out.println(d);
	}

} Main public static void main(String[] args) throws IOException {
		
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	int x = sc.nextInt();
    	int d = 0;
    	
    	if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x);
    	System.out.println(d);
	} main {
		
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	int x = sc.nextInt();
    	int d = 0;
    	
    	if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x);
    	System.out.println(d);
	} 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 x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int d = 0; d 0 if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x); a >= b && a >= c a >= b a b a >= c a c d += b + c + a * (int)Math.pow(2, x) d b + c + a * (int)Math.pow(2, x) b + c + a * (int)Math.pow(2, x) b c a * (int)Math.pow(2, x) a (int)Math.pow(2, x) Math.pow Math 2 x if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x); b >= a && b >= c b >= a b a b >= c b c d += a + c + b * (int)Math.pow(2, x) d a + c + b * (int)Math.pow(2, x) a + c + b * (int)Math.pow(2, x) a c b * (int)Math.pow(2, x) b (int)Math.pow(2, x) Math.pow Math 2 x if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x); c >= b && c >= b c >= b c b c >= b c b d += a + b + c * (int)Math.pow(2, x) d a + b + c * (int)Math.pow(2, x) a + b + c * (int)Math.pow(2, x) a b c * (int)Math.pow(2, x) c (int)Math.pow(2, x) Math.pow Math 2 x System.out.println(d) System.out.println System.out System System.out d String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	int x = sc.nextInt();
    	int d = 0;
    	
    	if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x);
    	System.out.println(d);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	int x = sc.nextInt();
    	int d = 0;
    	
    	if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x);
    	System.out.println(d);
	}

} Main
import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	int x = sc.nextInt();
    	int d = 0;
    	
    	if(a >= b && a >= c) d += b + c + a * (int)Math.pow(2, x);
    	else if(b >= a && b >= c) d += a + c + b * (int)Math.pow(2, x);
    	else if(c >= b && c >= b) d += a + b + c * (int)Math.pow(2, x);
    	System.out.println(d);
	}

}
