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