import java.util.Arrays;
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] abc = new int[3];
		    abc[0] = scanner.nextInt();
		    abc[1] = scanner.nextInt();
		    abc[2] = scanner.nextInt();
		    int k = scanner.nextInt();
		    
		    Arrays.sort(abc);
		    
		    System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k));
		    
		    scanner.close(); }
		  } import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] abc = new int[3];
		    abc[0] = scanner.nextInt();
		    abc[1] = scanner.nextInt();
		    abc[2] = scanner.nextInt();
		    int k = scanner.nextInt();
		    
		    Arrays.sort(abc);
		    
		    System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k));
		    
		    scanner.close(); }
		  } Main public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] abc = new int[3];
		    abc[0] = scanner.nextInt();
		    abc[1] = scanner.nextInt();
		    abc[2] = scanner.nextInt();
		    int k = scanner.nextInt();
		    
		    Arrays.sort(abc);
		    
		    System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k));
		    
		    scanner.close(); } main {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] abc = new int[3];
		    abc[0] = scanner.nextInt();
		    abc[1] = scanner.nextInt();
		    abc[2] = scanner.nextInt();
		    int k = scanner.nextInt();
		    
		    Arrays.sort(abc);
		    
		    System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k));
		    
		    scanner.close(); } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[] abc = new int[3]; abc new int[3] 3 abc[0] = scanner.nextInt() abc[0] abc 0 scanner.nextInt() scanner.nextInt scanner abc[1] = scanner.nextInt() abc[1] abc 1 scanner.nextInt() scanner.nextInt scanner abc[2] = scanner.nextInt() abc[2] abc 2 scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner Arrays.sort(abc) Arrays.sort Arrays abc System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k)) System.out.println System.out System System.out abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k) abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k) abc[0] abc 0 abc[1] abc 1 abc[2] * (int)Math.pow(2, k) abc[2] abc 2 (int)Math.pow(2, k) Math.pow Math 2 k scanner.close() scanner.close scanner String args[] args public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] abc = new int[3];
		    abc[0] = scanner.nextInt();
		    abc[1] = scanner.nextInt();
		    abc[2] = scanner.nextInt();
		    int k = scanner.nextInt();
		    
		    Arrays.sort(abc);
		    
		    System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k));
		    
		    scanner.close(); }
		  } public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] abc = new int[3];
		    abc[0] = scanner.nextInt();
		    abc[1] = scanner.nextInt();
		    abc[2] = scanner.nextInt();
		    int k = scanner.nextInt();
		    
		    Arrays.sort(abc);
		    
		    System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k));
		    
		    scanner.close(); }
		  } Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int[] abc = new int[3];
		    abc[0] = scanner.nextInt();
		    abc[1] = scanner.nextInt();
		    abc[2] = scanner.nextInt();
		    int k = scanner.nextInt();
		    
		    Arrays.sort(abc);
		    
		    System.out.println(abc[0] + abc[1] + abc[2] * (int)Math.pow(2, k));
		    
		    scanner.close(); }
		  }