import java.util.ArrayList;
import java.util.Scanner;

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();
		
		ArrayList<Integer> list = new ArrayList<>();
		list.add(a);
		list.add(b);
		list.add(c);
		list.sort(null);
		
		for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		}
		
		int result = list.get(0) + list.get(1) + list.get(2);
		System.out.println(result);
		
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner 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();
		
		ArrayList<Integer> list = new ArrayList<>();
		list.add(a);
		list.add(b);
		list.add(c);
		list.sort(null);
		
		for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		}
		
		int result = list.get(0) + list.get(1) + list.get(2);
		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();
		
		ArrayList<Integer> list = new ArrayList<>();
		list.add(a);
		list.add(b);
		list.add(c);
		list.sort(null);
		
		for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		}
		
		int result = list.get(0) + list.get(1) + list.get(2);
		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();
		
		ArrayList<Integer> list = new ArrayList<>();
		list.add(a);
		list.add(b);
		list.add(c);
		list.sort(null);
		
		for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		}
		
		int result = list.get(0) + list.get(1) + list.get(2);
		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 ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(a) list.add list a list.add(b) list.add list b list.add(c) list.add list c list.sort(null) list.sort list null for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		} {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		} int max = list.get(2) * 2; max list.get(2) * 2 list.get(2) list.get list 2 2 list.set(2, max) list.set list 2 max int result = list.get(0) + list.get(1) + list.get(2); result list.get(0) + list.get(1) + list.get(2) list.get(0) + list.get(1) + list.get(2) list.get(0) list.get list 0 list.get(1) list.get list 1 list.get(2) list.get list 2 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();
		
		ArrayList<Integer> list = new ArrayList<>();
		list.add(a);
		list.add(b);
		list.add(c);
		list.sort(null);
		
		for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		}
		
		int result = list.get(0) + list.get(1) + list.get(2);
		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();
		
		ArrayList<Integer> list = new ArrayList<>();
		list.add(a);
		list.add(b);
		list.add(c);
		list.sort(null);
		
		for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		}
		
		int result = list.get(0) + list.get(1) + list.get(2);
		System.out.println(result);
		
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

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();
		
		ArrayList<Integer> list = new ArrayList<>();
		list.add(a);
		list.add(b);
		list.add(c);
		list.sort(null);
		
		for(int i = 0; i < k; i++) {
			int max = list.get(2) * 2;
			list.set(2, max);
			
		}
		
		int result = list.get(0) + list.get(1) + list.get(2);
		System.out.println(result);
		
	}
}