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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int[] num = new int[3];
		num[0] = sc1.nextInt();
		num[1] = sc1.nextInt();
		num[2] = sc1.nextInt();
		int k = sc1.nextInt();
		Arrays.sort(num);

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

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

		sc1.close();

	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int[] num = new int[3];
		num[0] = sc1.nextInt();
		num[1] = sc1.nextInt();
		num[2] = sc1.nextInt();
		int k = sc1.nextInt();
		Arrays.sort(num);

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

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

		sc1.close();

	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int[] num = new int[3];
		num[0] = sc1.nextInt();
		num[1] = sc1.nextInt();
		num[2] = sc1.nextInt();
		int k = sc1.nextInt();
		Arrays.sort(num);

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

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

		sc1.close();

	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int[] num = new int[3];
		num[0] = sc1.nextInt();
		num[1] = sc1.nextInt();
		num[2] = sc1.nextInt();
		int k = sc1.nextInt();
		Arrays.sort(num);

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

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

		sc1.close();

	} Scanner sc1 = new Scanner(System.in); sc1 new Scanner(System.in) int[] num = new int[3]; num new int[3] 3 num[0] = sc1.nextInt() num[0] num 0 sc1.nextInt() sc1.nextInt sc1 num[1] = sc1.nextInt() num[1] num 1 sc1.nextInt() sc1.nextInt sc1 num[2] = sc1.nextInt() num[2] num 2 sc1.nextInt() sc1.nextInt sc1 int k = sc1.nextInt(); k sc1.nextInt() sc1.nextInt sc1 Arrays.sort(num) Arrays.sort Arrays num for (int i = 0 ; i < k ; i++ ) {
			num[2] *= 2;
		} int i = 0 ; int i = 0 ; i 0 i < k i k i++ i++ i {
			num[2] *= 2;
		} {
			num[2] *= 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 sc1.close() sc1.close sc1 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int[] num = new int[3];
		num[0] = sc1.nextInt();
		num[1] = sc1.nextInt();
		num[2] = sc1.nextInt();
		int k = sc1.nextInt();
		Arrays.sort(num);

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

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

		sc1.close();

	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int[] num = new int[3];
		num[0] = sc1.nextInt();
		num[1] = sc1.nextInt();
		num[2] = sc1.nextInt();
		int k = sc1.nextInt();
		Arrays.sort(num);

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

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

		sc1.close();

	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc1 = new Scanner(System.in);

		int[] num = new int[3];
		num[0] = sc1.nextInt();
		num[1] = sc1.nextInt();
		num[2] = sc1.nextInt();
		int k = sc1.nextInt();
		Arrays.sort(num);

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

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

		sc1.close();

	}

}