import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    } in.hasNext() in.hasNext in {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    } int A = in.nextInt(); A in.nextInt() in.nextInt in int B = in.nextInt(); B in.nextInt() in.nextInt in int C = in.nextInt(); C in.nextInt() in.nextInt in int K = in.nextInt(); K in.nextInt() in.nextInt in long max = Math.max(A, Math.max(B, C)); max Math.max(A, Math.max(B, C)) Math.max Math A Math.max(B, C) Math.max Math B C long replacedMax = max; replacedMax max while (K-- > 0){
        replacedMax *= 2;
      } K-- > 0 K-- K 0 {
        replacedMax *= 2;
      } replacedMax *= 2 replacedMax 2 System.out.println(replacedMax + A + B + C - max) System.out.println System.out System System.out replacedMax + A + B + C - max replacedMax + A + B + C B replacedMax + A + B + C replacedMax A B C max String[] args args public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    }
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int A = in.nextInt();
      int B = in.nextInt();
      int C = in.nextInt();
      int K = in.nextInt();
      long max = Math.max(A, Math.max(B, C));
      long replacedMax = max;

      while (K-- > 0){
        replacedMax *= 2;
      }
  
      System.out.println(replacedMax + A + B + C - max);
    }
  }
}