import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    int a = A;
    int b = B;
    int c = C;
    for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    }
    
    System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c)));
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    int a = A;
    int b = B;
    int c = C;
    for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    }
    
    System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c)));
  }
} Main public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    int a = A;
    int b = B;
    int c = C;
    for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    }
    
    System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c)));
  } main {
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    int a = A;
    int b = B;
    int c = C;
    for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    }
    
    System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c)));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a = A; a A int b = B; b B int c = C; c C for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
      a *= 2;
      b *= 2;
      c *= 2;
    } {
      a *= 2;
      b *= 2;
      c *= 2;
    } a *= 2 a 2 b *= 2 b 2 c *= 2 c 2 System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c))) System.out.println System.out System System.out Math.max(a+B+C, Math.max(A+b+C, A+B+c)) Math.max Math a+B+C a+B+C a B C Math.max(A+b+C, A+B+c) Math.max Math A+b+C A+b+C A b C A+B+c A+B+c A B c String[]args args public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    int a = A;
    int b = B;
    int c = C;
    for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    }
    
    System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c)));
  }
} public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    int a = A;
    int b = B;
    int c = C;
    for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    }
    
    System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c)));
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    int C = Integer.parseInt(sc.next());
    int K = Integer.parseInt(sc.next());
    
    int a = A;
    int b = B;
    int c = C;
    for(int i = 0; i < K; i++){
      a *= 2;
      b *= 2;
      c *= 2;
    }
    
    System.out.println(Math.max(a+B+C, Math.max(A+b+C, A+B+c)));
  }
}