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), C);
    long ans = A + B + C - max + power(max, K);
    
    System.out.println(ans);
  }
  
  private static long power(int max, int K) {
    long ret = max;
    for (int i = 0; i < K; i++) {
      ret *= 2;
    }
    return ret;
  }
} 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), C);
    long ans = A + B + C - max + power(max, K);
    
    System.out.println(ans);
  }
  
  private static long power(int max, int K) {
    long ret = max;
    for (int i = 0; i < K; i++) {
      ret *= 2;
    }
    return ret;
  }
} 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), C);
    long ans = A + B + C - max + power(max, K);
    
    System.out.println(ans);
  } 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), C);
    long ans = A + B + C - max + power(max, K);
    
    System.out.println(ans);
  } 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), C); max Math.max(Math.max(A, B), C) Math.max Math Math.max(A, B) Math.max Math A B C long ans = A + B + C - max + power(max, K); ans A + B + C - max + power(max, K) A + B + C - max A + B + C A + B + C A B C max power(max, K) power max K System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static long power(int max, int K) {
    long ret = max;
    for (int i = 0; i < K; i++) {
      ret *= 2;
    }
    return ret;
  } power {
    long ret = max;
    for (int i = 0; i < K; i++) {
      ret *= 2;
    }
    return ret;
  } long ret = max; ret max for (int i = 0; i < K; i++) {
      ret *= 2;
    } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
      ret *= 2;
    } {
      ret *= 2;
    } ret *= 2 ret 2 return ret; ret int max max int K 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), C);
    long ans = A + B + C - max + power(max, K);
    
    System.out.println(ans);
  }
  
  private static long power(int max, int K) {
    long ret = max;
    for (int i = 0; i < K; i++) {
      ret *= 2;
    }
    return ret;
  }
} 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), C);
    long ans = A + B + C - max + power(max, K);
    
    System.out.println(ans);
  }
  
  private static long power(int max, int K) {
    long ret = max;
    for (int i = 0; i < K; i++) {
      ret *= 2;
    }
    return ret;
  }
} 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), C);
    long ans = A + B + C - max + power(max, K);
    
    System.out.println(ans);
  }
  
  private static long power(int max, int K) {
    long ret = max;
    for (int i = 0; i < K; i++) {
      ret *= 2;
    }
    return ret;
  }
}