import 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();
    int max = Math.max(Math.max(A,B),Math.max(B,C));
    int res = A + B + C - max;
    System.out.println(res + max * (int)Math.pow(2,K));
  }
} import java.util.*; util.* 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();
    int max = Math.max(Math.max(A,B),Math.max(B,C));
    int res = A + B + C - max;
    System.out.println(res + max * (int)Math.pow(2,K));
  }
} 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();
    int max = Math.max(Math.max(A,B),Math.max(B,C));
    int res = A + B + C - max;
    System.out.println(res + max * (int)Math.pow(2,K));
  } main {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();    
    int C = sc.nextInt();    
    int K = sc.nextInt();
    int max = Math.max(Math.max(A,B),Math.max(B,C));
    int res = A + B + C - max;
    System.out.println(res + max * (int)Math.pow(2,K));
  } 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 int max = Math.max(Math.max(A,B),Math.max(B,C)); max Math.max(Math.max(A,B),Math.max(B,C)) Math.max Math Math.max(A,B) Math.max Math A B Math.max(B,C) Math.max Math B C int res = A + B + C - max; res A + B + C - max A + B + C A + B + C A B C max System.out.println(res + max * (int)Math.pow(2,K)) System.out.println System.out System System.out res + max * (int)Math.pow(2,K) res max * (int)Math.pow(2,K) max (int)Math.pow(2,K) Math.pow Math 2 K 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();
    int max = Math.max(Math.max(A,B),Math.max(B,C));
    int res = A + B + C - max;
    System.out.println(res + max * (int)Math.pow(2,K));
  }
} 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();
    int max = Math.max(Math.max(A,B),Math.max(B,C));
    int res = A + B + C - max;
    System.out.println(res + max * (int)Math.pow(2,K));
  }
} Main
import 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();
    int max = Math.max(Math.max(A,B),Math.max(B,C));
    int res = A + B + C - max;
    System.out.println(res + max * (int)Math.pow(2,K));
  }
}