import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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[] num = new int[3];
    num[0] = a;
    num[1] = b;
    num[2] = c;
    Arrays.sort(num);

    for (int i = 0; i < k; i++) {
      num[2] = num[2] * 2;
    }

    System.out.println(num[0] + num[1] + num[2]);
  }
} import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util 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[] num = new int[3];
    num[0] = a;
    num[1] = b;
    num[2] = c;
    Arrays.sort(num);

    for (int i = 0; i < k; i++) {
      num[2] = num[2] * 2;
    }

    System.out.println(num[0] + num[1] + num[2]);
  }
} 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[] num = new int[3];
    num[0] = a;
    num[1] = b;
    num[2] = c;
    Arrays.sort(num);

    for (int i = 0; i < k; i++) {
      num[2] = num[2] * 2;
    }

    System.out.println(num[0] + num[1] + num[2]);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int k = sc.nextInt();

    int[] num = new int[3];
    num[0] = a;
    num[1] = b;
    num[2] = c;
    Arrays.sort(num);

    for (int i = 0; i < k; i++) {
      num[2] = num[2] * 2;
    }

    System.out.println(num[0] + num[1] + num[2]);
  } 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[] num = new int[3]; num new int[3] 3 num[0] = a num[0] num 0 a num[1] = b num[1] num 1 b num[2] = c num[2] num 2 c Arrays.sort(num) Arrays.sort Arrays num for (int i = 0; i < k; i++) {
      num[2] = num[2] * 2;
    } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
      num[2] = num[2] * 2;
    } {
      num[2] = num[2] * 2;
    } num[2] = num[2] * 2 num[2] num 2 num[2] * 2 num[2] num 2 2 System.out.println(num[0] + num[1] + num[2]) System.out.println System.out System System.out num[0] + num[1] + num[2] num[0] + num[1] + num[2] num[0] num 0 num[1] num 1 num[2] num 2 String[] args args
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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[] num = new int[3];
    num[0] = a;
    num[1] = b;
    num[2] = c;
    Arrays.sort(num);

    for (int i = 0; i < k; i++) {
      num[2] = num[2] * 2;
    }

    System.out.println(num[0] + num[1] + num[2]);
  }
}