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

public class Main {

	public static void main(String[] args){
	      Scanner sc = new Scanner(System.in);
	      int[] ABC = new int[3];
	      ABC[0] = sc.nextInt();
	      ABC[1] = sc.nextInt();
	      ABC[2] = sc.nextInt();
	      int K = sc.nextInt();
	      sc.close();
	      
	      Arrays.sort(ABC);
	      for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      }
	      int answer = ABC[0] + ABC[1] + ABC[2];
	      
	      System.out.println(answer);
	      System.exit(0);
	    }
} import java.util.Arrays; Arrays 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[] ABC = new int[3];
	      ABC[0] = sc.nextInt();
	      ABC[1] = sc.nextInt();
	      ABC[2] = sc.nextInt();
	      int K = sc.nextInt();
	      sc.close();
	      
	      Arrays.sort(ABC);
	      for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      }
	      int answer = ABC[0] + ABC[1] + ABC[2];
	      
	      System.out.println(answer);
	      System.exit(0);
	    }
} Main public static void main(String[] args){
	      Scanner sc = new Scanner(System.in);
	      int[] ABC = new int[3];
	      ABC[0] = sc.nextInt();
	      ABC[1] = sc.nextInt();
	      ABC[2] = sc.nextInt();
	      int K = sc.nextInt();
	      sc.close();
	      
	      Arrays.sort(ABC);
	      for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      }
	      int answer = ABC[0] + ABC[1] + ABC[2];
	      
	      System.out.println(answer);
	      System.exit(0);
	    } main {
	      Scanner sc = new Scanner(System.in);
	      int[] ABC = new int[3];
	      ABC[0] = sc.nextInt();
	      ABC[1] = sc.nextInt();
	      ABC[2] = sc.nextInt();
	      int K = sc.nextInt();
	      sc.close();
	      
	      Arrays.sort(ABC);
	      for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      }
	      int answer = ABC[0] + ABC[1] + ABC[2];
	      
	      System.out.println(answer);
	      System.exit(0);
	    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] ABC = new int[3]; ABC new int[3] 3 ABC[0] = sc.nextInt() ABC[0] ABC 0 sc.nextInt() sc.nextInt sc ABC[1] = sc.nextInt() ABC[1] ABC 1 sc.nextInt() sc.nextInt sc ABC[2] = sc.nextInt() ABC[2] ABC 2 sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc sc.close() sc.close sc Arrays.sort(ABC) Arrays.sort Arrays ABC for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
	    	  	ABC[2] *= 2;
	      } {
	    	  	ABC[2] *= 2;
	      } ABC[2] *= 2 ABC[2] ABC 2 2 int answer = ABC[0] + ABC[1] + ABC[2]; answer ABC[0] + ABC[1] + ABC[2] ABC[0] + ABC[1] + ABC[2] ABC[0] ABC 0 ABC[1] ABC 1 ABC[2] ABC 2 System.out.println(answer) System.out.println System.out System System.out answer System.exit(0) System.exit System 0 String[] args args public class Main {

	public static void main(String[] args){
	      Scanner sc = new Scanner(System.in);
	      int[] ABC = new int[3];
	      ABC[0] = sc.nextInt();
	      ABC[1] = sc.nextInt();
	      ABC[2] = sc.nextInt();
	      int K = sc.nextInt();
	      sc.close();
	      
	      Arrays.sort(ABC);
	      for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      }
	      int answer = ABC[0] + ABC[1] + ABC[2];
	      
	      System.out.println(answer);
	      System.exit(0);
	    }
} public class Main {

	public static void main(String[] args){
	      Scanner sc = new Scanner(System.in);
	      int[] ABC = new int[3];
	      ABC[0] = sc.nextInt();
	      ABC[1] = sc.nextInt();
	      ABC[2] = sc.nextInt();
	      int K = sc.nextInt();
	      sc.close();
	      
	      Arrays.sort(ABC);
	      for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      }
	      int answer = ABC[0] + ABC[1] + ABC[2];
	      
	      System.out.println(answer);
	      System.exit(0);
	    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
	      Scanner sc = new Scanner(System.in);
	      int[] ABC = new int[3];
	      ABC[0] = sc.nextInt();
	      ABC[1] = sc.nextInt();
	      ABC[2] = sc.nextInt();
	      int K = sc.nextInt();
	      sc.close();
	      
	      Arrays.sort(ABC);
	      for(int i = 0; i < K; i++) {
	    	  	ABC[2] *= 2;
	      }
	      int answer = ABC[0] + ABC[1] + ABC[2];
	      
	      System.out.println(answer);
	      System.exit(0);
	    }
}