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 = a;
   int maxindex = 0;
   int[] num = new int[]{a, b, c};
    for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    }
    for (int i = 0; i < k; i++ ) {
      max = max * 2;
    }
    if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    }
  }
} 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 = a;
   int maxindex = 0;
   int[] num = new int[]{a, b, c};
    for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    }
    for (int i = 0; i < k; i++ ) {
      max = max * 2;
    }
    if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    }
  }
} 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 = a;
   int maxindex = 0;
   int[] num = new int[]{a, b, c};
    for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    }
    for (int i = 0; i < k; i++ ) {
      max = max * 2;
    }
    if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    }
  } 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 = a;
   int maxindex = 0;
   int[] num = new int[]{a, b, c};
    for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    }
    for (int i = 0; i < k; i++ ) {
      max = max * 2;
    }
    if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    }
  } 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 = a; max a int maxindex = 0; maxindex 0 int[] num = new int[]{a, b, c}; num new int[]{a, b, c} for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    } int i = 1; int i = 1; i 1 i < num.length i num.length num num.length i++ i++ i {
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    } {
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    } int j = num[i]; j num[i] num i if(max < num[i]){
        max = j;
        maxindex = i;
      } max < num[i] max num[i] num i {
        max = j;
        maxindex = i;
      } max = j max j maxindex = i maxindex i for (int i = 0; i < k; i++ ) {
      max = max * 2;
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      max = max * 2;
    } {
      max = max * 2;
    } max = max * 2 max max * 2 max 2 if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    } maxindex == 0 maxindex 0 {
      System.out.println(max + b + c);
    } System.out.println(max + b + c) System.out.println System.out System System.out max + b + c max + b + c max b c if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    } maxindex == 1 maxindex 1 {
      System.out.println(a + max + c);
    } System.out.println(a + max + c) System.out.println System.out System System.out a + max + c a + max + c a max c {
      System.out.println(a + b + max);
    } System.out.println(a + b + max) System.out.println System.out System System.out a + b + max a + b + max a b max 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 = a;
   int maxindex = 0;
   int[] num = new int[]{a, b, c};
    for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    }
    for (int i = 0; i < k; i++ ) {
      max = max * 2;
    }
    if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    }
  }
} 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 = a;
   int maxindex = 0;
   int[] num = new int[]{a, b, c};
    for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    }
    for (int i = 0; i < k; i++ ) {
      max = max * 2;
    }
    if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    }
  }
} 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 = a;
   int maxindex = 0;
   int[] num = new int[]{a, b, c};
    for(int i = 1; i < num.length; i++){
      int j = num[i];
      if(max < num[i]){
        max = j;
        maxindex = i;
      }
    }
    for (int i = 0; i < k; i++ ) {
      max = max * 2;
    }
    if(maxindex == 0){
      System.out.println(max + b + c);
    }else if(maxindex == 1){
      System.out.println(a + max + c);
    }else{
      System.out.println(a + b + max);
    }
  }
}
