import java.lang.*;
import java.util.*;


public class Main {

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();
    int k = scan.nextInt();

    int max = a;
    if (b > max) {
      max = b;
    }
    if (c > max) {
      max = c;
    }

    long sum = max * (long)Math.pow(2, k) + a + b + c - max;
    System.out.println(sum);
  }
} import java.lang.*; lang.* java import java.util.*; util.* java public class Main {

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();
    int k = scan.nextInt();

    int max = a;
    if (b > max) {
      max = b;
    }
    if (c > max) {
      max = c;
    }

    long sum = max * (long)Math.pow(2, k) + a + b + c - max;
    System.out.println(sum);
  }
} Main public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  } main {
    Main m = new Main();
    m.exec();
  } Main m = new Main(); m new Main() m.exec() m.exec m String[] args args private void exec() {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();
    int k = scan.nextInt();

    int max = a;
    if (b > max) {
      max = b;
    }
    if (c > max) {
      max = c;
    }

    long sum = max * (long)Math.pow(2, k) + a + b + c - max;
    System.out.println(sum);
  } exec {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();
    int k = scan.nextInt();

    int max = a;
    if (b > max) {
      max = b;
    }
    if (c > max) {
      max = c;
    }

    long sum = max * (long)Math.pow(2, k) + a + b + c - max;
    System.out.println(sum);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int max = a; max a if (b > max) {
      max = b;
    } b > max b max {
      max = b;
    } max = b max b if (c > max) {
      max = c;
    } c > max c max {
      max = c;
    } max = c max c long sum = max * (long)Math.pow(2, k) + a + b + c - max; sum max * (long)Math.pow(2, k) + a + b + c - max max * (long)Math.pow(2, k) + a + b + c b max * (long)Math.pow(2, k) + a + b + c max * (long)Math.pow(2, k) max (long)Math.pow(2, k) Math.pow Math 2 k a b c max System.out.println(sum) System.out.println System.out System System.out sum public class Main {

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();
    int k = scan.nextInt();

    int max = a;
    if (b > max) {
      max = b;
    }
    if (c > max) {
      max = c;
    }

    long sum = max * (long)Math.pow(2, k) + a + b + c - max;
    System.out.println(sum);
  }
} public class Main {

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();
    int k = scan.nextInt();

    int max = a;
    if (b > max) {
      max = b;
    }
    if (c > max) {
      max = c;
    }

    long sum = max * (long)Math.pow(2, k) + a + b + c - max;
    System.out.println(sum);
  }
} Main
import java.lang.*;
import java.util.*;


public class Main {

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();
    int k = scan.nextInt();

    int max = a;
    if (b > max) {
      max = b;
    }
    if (c > max) {
      max = c;
    }

    long sum = max * (long)Math.pow(2, k) + a + b + c - max;
    System.out.println(sum);
  }
}