import java.util.*;

public class Main {

	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[3];
		int total = 0;
		for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		}
		int k = sc.nextInt();
		Arrays.sort(arr);
		int max = arr[2];
		long dob = arr[2];
		for (int i = 0; i < k; i++) {
			dob *= 2;
		}
		System.out.println(total - max + dob);
	}
} import java.util.*; util.* java public class Main {

	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[3];
		int total = 0;
		for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		}
		int k = sc.nextInt();
		Arrays.sort(arr);
		int max = arr[2];
		long dob = arr[2];
		for (int i = 0; i < k; i++) {
			dob *= 2;
		}
		System.out.println(total - max + dob);
	}
} Main public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[3];
		int total = 0;
		for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		}
		int k = sc.nextInt();
		Arrays.sort(arr);
		int max = arr[2];
		long dob = arr[2];
		for (int i = 0; i < k; i++) {
			dob *= 2;
		}
		System.out.println(total - max + dob);
	} main {
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[3];
		int total = 0;
		for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		}
		int k = sc.nextInt();
		Arrays.sort(arr);
		int max = arr[2];
		long dob = arr[2];
		for (int i = 0; i < k; i++) {
			dob *= 2;
		}
		System.out.println(total - max + dob);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] arr = new int[3]; arr new int[3] 3 int total = 0; total 0 for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			arr[i] = sc.nextInt();
			total += arr[i];
		} {
			arr[i] = sc.nextInt();
			total += arr[i];
		} arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc total += arr[i] total arr[i] arr i int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc Arrays.sort(arr) Arrays.sort Arrays arr int max = arr[2]; max arr[2] arr 2 long dob = arr[2]; dob arr[2] arr 2 for (int i = 0; i < k; i++) {
			dob *= 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			dob *= 2;
		} {
			dob *= 2;
		} dob *= 2 dob 2 System.out.println(total - max + dob) System.out.println System.out System System.out total - max + dob total - max total max dob String[] args args public class Main {

	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[3];
		int total = 0;
		for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		}
		int k = sc.nextInt();
		Arrays.sort(arr);
		int max = arr[2];
		long dob = arr[2];
		for (int i = 0; i < k; i++) {
			dob *= 2;
		}
		System.out.println(total - max + dob);
	}
} public class Main {

	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[3];
		int total = 0;
		for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		}
		int k = sc.nextInt();
		Arrays.sort(arr);
		int max = arr[2];
		long dob = arr[2];
		for (int i = 0; i < k; i++) {
			dob *= 2;
		}
		System.out.println(total - max + dob);
	}
} Main
import java.util.*;

public class Main {

	public static void main (String[] args)  {
		Scanner sc = new Scanner(System.in);
		int[] arr = new int[3];
		int total = 0;
		for (int i = 0; i < 3; i++) {
			arr[i] = sc.nextInt();
			total += arr[i];
		}
		int k = sc.nextInt();
		Arrays.sort(arr);
		int max = arr[2];
		long dob = arr[2];
		for (int i = 0; i < k; i++) {
			dob *= 2;
		}
		System.out.println(total - max + dob);
	}
}
