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

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);

		int[] arr = new int[3];
		arr[0] = reader.nextInt();
		arr[1] = reader.nextInt();
		arr[2] = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		Arrays.sort(arr);
		for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		}
		for (int i = 0; i < 3; i++) {
			ans += arr[i];
		}



		System.out.print(ans);
		reader.close();
	}
}


 import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);

		int[] arr = new int[3];
		arr[0] = reader.nextInt();
		arr[1] = reader.nextInt();
		arr[2] = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		Arrays.sort(arr);
		for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		}
		for (int i = 0; i < 3; i++) {
			ans += arr[i];
		}



		System.out.print(ans);
		reader.close();
	}
} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);

		int[] arr = new int[3];
		arr[0] = reader.nextInt();
		arr[1] = reader.nextInt();
		arr[2] = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		Arrays.sort(arr);
		for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		}
		for (int i = 0; i < 3; i++) {
			ans += arr[i];
		}



		System.out.print(ans);
		reader.close();
	} main {
		Scanner reader = new Scanner(System.in);

		int[] arr = new int[3];
		arr[0] = reader.nextInt();
		arr[1] = reader.nextInt();
		arr[2] = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		Arrays.sort(arr);
		for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		}
		for (int i = 0; i < 3; i++) {
			ans += arr[i];
		}



		System.out.print(ans);
		reader.close();
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int[] arr = new int[3]; arr new int[3] 3 arr[0] = reader.nextInt() arr[0] arr 0 reader.nextInt() reader.nextInt reader arr[1] = reader.nextInt() arr[1] arr 1 reader.nextInt() reader.nextInt reader arr[2] = reader.nextInt() arr[2] arr 2 reader.nextInt() reader.nextInt reader int K = reader.nextInt(); K reader.nextInt() reader.nextInt reader int ans = 0; ans 0 Arrays.sort(arr) Arrays.sort Arrays arr for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		} int i = 0; int i = 0; i 0 i< K i K i++ i++ i {
			arr[2] *= 2;
		} {
			arr[2] *= 2;
		} arr[2] *= 2 arr[2] arr 2 2 for (int i = 0; i < 3; i++) {
			ans += arr[i];
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			ans += arr[i];
		} {
			ans += arr[i];
		} ans += arr[i] ans arr[i] arr i System.out.print(ans) System.out.print System.out System System.out ans reader.close() reader.close reader String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);

		int[] arr = new int[3];
		arr[0] = reader.nextInt();
		arr[1] = reader.nextInt();
		arr[2] = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		Arrays.sort(arr);
		for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		}
		for (int i = 0; i < 3; i++) {
			ans += arr[i];
		}



		System.out.print(ans);
		reader.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);

		int[] arr = new int[3];
		arr[0] = reader.nextInt();
		arr[1] = reader.nextInt();
		arr[2] = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		Arrays.sort(arr);
		for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		}
		for (int i = 0; i < 3; i++) {
			ans += arr[i];
		}



		System.out.print(ans);
		reader.close();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);

		int[] arr = new int[3];
		arr[0] = reader.nextInt();
		arr[1] = reader.nextInt();
		arr[2] = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		Arrays.sort(arr);
		for (int i = 0; i< K; i++) {
			arr[2] *= 2;
		}
		for (int i = 0; i < 3; i++) {
			ans += arr[i];
		}



		System.out.print(ans);
		reader.close();
	}
}



