import java.util.Scanner;

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 = Math.max(Math.max(a, b), c);

    System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k)));

  }
} import java.util.Scanner; Scanner 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 = Math.max(Math.max(a, b), c);

    System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k)));

  }
} 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 = Math.max(Math.max(a, b), c);

    System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k)));

  } 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 = Math.max(Math.max(a, b), c);

    System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k)));

  } 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 = Math.max(Math.max(a, b), c); max Math.max(Math.max(a, b), c) Math.max Math Math.max(a, b) Math.max Math a b c System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k))) System.out.println System.out System System.out ((a + b + c) - max) + (max * (int) Math.pow(2, k)) ((a + b + c) - max) (a + b + c) a + b + c a b c max (max * (int) Math.pow(2, k)) max (int) Math.pow(2, k) Math.pow Math 2 k 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 = Math.max(Math.max(a, b), c);

    System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k)));

  }
} 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 = Math.max(Math.max(a, b), c);

    System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k)));

  }
} Main
import java.util.Scanner;

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 = Math.max(Math.max(a, b), c);

    System.out.println(((a + b + c) - max) + (max * (int) Math.pow(2, k)));

  }
}