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