import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];
		A[0] = sc.nextInt();
		A[1] = sc.nextInt();
		A[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.parallelSort(A);
		System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K)));
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];
		A[0] = sc.nextInt();
		A[1] = sc.nextInt();
		A[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.parallelSort(A);
		System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K)));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];
		A[0] = sc.nextInt();
		A[1] = sc.nextInt();
		A[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.parallelSort(A);
		System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K)));
	} main {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];
		A[0] = sc.nextInt();
		A[1] = sc.nextInt();
		A[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.parallelSort(A);
		System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K)));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A[] = new int[3]; A new int[3] 3 A[0] = sc.nextInt() A[0] A 0 sc.nextInt() sc.nextInt sc A[1] = sc.nextInt() A[1] A 1 sc.nextInt() sc.nextInt sc A[2] = sc.nextInt() A[2] A 2 sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc Arrays.parallelSort(A) Arrays.parallelSort Arrays A System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K))) System.out.println System.out System System.out A[0]+A[1]+(int)(A[2]*Math.pow(2, K)) A[0]+A[1]+(int)(A[2]*Math.pow(2, K)) A[0] A 0 A[1] A 1 (int)(A[2]*Math.pow(2, K)) A[2] A 2 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[] = new int[3];
		A[0] = sc.nextInt();
		A[1] = sc.nextInt();
		A[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.parallelSort(A);
		System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K)));
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];
		A[0] = sc.nextInt();
		A[1] = sc.nextInt();
		A[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.parallelSort(A);
		System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K)));
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[] = new int[3];
		A[0] = sc.nextInt();
		A[1] = sc.nextInt();
		A[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.parallelSort(A);
		System.out.println(A[0]+A[1]+(int)(A[2]*Math.pow(2, K)));
	}
}