import java.util.Scanner;

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 max = Math.max(A, Math.max(B, C));
    int sum = A + B + C - max;
    sum += max * Math.pow(2, K);

    System.out.println(sum);

  }
} import java.util.Scanner; Scanner 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 max = Math.max(A, Math.max(B, C));
    int sum = A + B + C - max;
    sum += max * Math.pow(2, K);

    System.out.println(sum);

  }
} 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 max = Math.max(A, Math.max(B, C));
    int sum = A + B + C - max;
    sum += max * Math.pow(2, K);

    System.out.println(sum);

  } 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 max = Math.max(A, Math.max(B, C));
    int sum = A + B + C - max;
    sum += max * Math.pow(2, K);

    System.out.println(sum);

  } 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 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 int sum = A + B + C - max; sum A + B + C - max A + B + C A + B + C A B C max sum += max * Math.pow(2, K) sum max * Math.pow(2, K) max Math.pow(2, K) Math.pow Math 2 K System.out.println(sum) System.out.println System.out System System.out sum 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 max = Math.max(A, Math.max(B, C));
    int sum = A + B + C - max;
    sum += max * Math.pow(2, K);

    System.out.println(sum);

  }
} 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 max = Math.max(A, Math.max(B, C));
    int sum = A + B + C - max;
    sum += max * Math.pow(2, K);

    System.out.println(sum);

  }
} Main
import java.util.Scanner;

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 max = Math.max(A, Math.max(B, C));
    int sum = A + B + C - max;
    sum += max * Math.pow(2, K);

    System.out.println(sum);

  }
}