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_ab = Integer.max(a, b);
    int max_bc = Integer.max(b, c);
    int max = Integer.max(max_ab, max_bc);
    int result = max;
    for (int i = 0; i < k; i++) {
      result *= 2;
    }
    result = result + a + b + c - max;
    System.out.println(result);
  }
} 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_ab = Integer.max(a, b);
    int max_bc = Integer.max(b, c);
    int max = Integer.max(max_ab, max_bc);
    int result = max;
    for (int i = 0; i < k; i++) {
      result *= 2;
    }
    result = result + a + b + c - max;
    System.out.println(result);
  }
} 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_ab = Integer.max(a, b);
    int max_bc = Integer.max(b, c);
    int max = Integer.max(max_ab, max_bc);
    int result = max;
    for (int i = 0; i < k; i++) {
      result *= 2;
    }
    result = result + a + b + c - max;
    System.out.println(result);
  } 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_ab = Integer.max(a, b);
    int max_bc = Integer.max(b, c);
    int max = Integer.max(max_ab, max_bc);
    int result = max;
    for (int i = 0; i < k; i++) {
      result *= 2;
    }
    result = result + a + b + c - max;
    System.out.println(result);
  } 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_ab = Integer.max(a, b); max_ab Integer.max(a, b) Integer.max Integer a b int max_bc = Integer.max(b, c); max_bc Integer.max(b, c) Integer.max Integer b c int max = Integer.max(max_ab, max_bc); max Integer.max(max_ab, max_bc) Integer.max Integer max_ab max_bc int result = max; result max for (int i = 0; i < k; i++) {
      result *= 2;
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      result *= 2;
    } {
      result *= 2;
    } result *= 2 result 2 result = result + a + b + c - max result result + a + b + c - max result + a + b + c b result + a + b + c result a b c max System.out.println(result) System.out.println System.out System System.out result 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_ab = Integer.max(a, b);
    int max_bc = Integer.max(b, c);
    int max = Integer.max(max_ab, max_bc);
    int result = max;
    for (int i = 0; i < k; i++) {
      result *= 2;
    }
    result = result + a + b + c - max;
    System.out.println(result);
  }
} 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_ab = Integer.max(a, b);
    int max_bc = Integer.max(b, c);
    int max = Integer.max(max_ab, max_bc);
    int result = max;
    for (int i = 0; i < k; i++) {
      result *= 2;
    }
    result = result + a + b + c - max;
    System.out.println(result);
  }
} 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_ab = Integer.max(a, b);
    int max_bc = Integer.max(b, c);
    int max = Integer.max(max_ab, max_bc);
    int result = max;
    for (int i = 0; i < k; i++) {
      result *= 2;
    }
    result = result + a + b + c - max;
    System.out.println(result);
  }
}