import java.util.Scanner;

public 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();
		// 文字列の入力
		// String s = sc.next();
		// 出力
		// System.out11.println((a+b+c) + " " + s);

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		}


		System.out.println(a + b + c);


	}

	private static int[] getMax(int a, int b, int c) {
		int[] newInput = new int[]{a, b, c};

		if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		}

		return newInput;

	}

} import java.util.Scanner; Scanner java.util public 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();
		// 文字列の入力
		// String s = sc.next();
		// 出力
		// System.out11.println((a+b+c) + " " + s);

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		}


		System.out.println(a + b + c);


	}

	private static int[] getMax(int a, int b, int c) {
		int[] newInput = new int[]{a, b, c};

		if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		}

		return newInput;

	}

} 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();
		// 文字列の入力
		// String s = sc.next();
		// 出力
		// System.out11.println((a+b+c) + " " + s);

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		}


		System.out.println(a + b + c);


	} main {

		// Scanner sc = new Scanner(System.in);
		// 整数の入力
		// int a = sc.nextInt();
		// スペース区切りの整数の入力
		// int b = sc.nextInt();
		// int c = sc.nextInt();
		// 文字列の入力
		// String s = sc.next();
		// 出力
		// System.out11.println((a+b+c) + " " + s);

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		}


		System.out.println(a + b + c);


	} 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 for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		} {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		} int[] result = getMax(a, b, c); result getMax(a, b, c) getMax a b c a = result[0] a result[0] result 0 b = result[1] b result[1] result 1 c = result[2] c result[2] result 2 System.out.println(a + b + c) System.out.println System.out System System.out a + b + c a + b + c a b c String[] args args private static int[] getMax(int a, int b, int c) {
		int[] newInput = new int[]{a, b, c};

		if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		}

		return newInput;

	} getMax {
		int[] newInput = new int[]{a, b, c};

		if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		}

		return newInput;

	} int[] newInput = new int[]{a, b, c}; newInput new int[]{a, b, c} if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		} a <= b && c <= b a <= b a b c <= b c b {
			newInput[1] = 2*b;
		} newInput[1] = 2*b newInput[1] newInput 1 2*b 2 b if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		} b <= a && c <= a b <= a b a c <= a c a {
			newInput[0] = 2*a;
		} newInput[0] = 2*a newInput[0] newInput 0 2*a 2 a if (a <= c && b <= c) {
			newInput[2] = 2*c;
		} a <= c && b <= c a <= c a c b <= c b c {
			newInput[2] = 2*c;
		} newInput[2] = 2*c newInput[2] newInput 2 2*c 2 c return newInput; newInput int a a int b b int c c public 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();
		// 文字列の入力
		// String s = sc.next();
		// 出力
		// System.out11.println((a+b+c) + " " + s);

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		}


		System.out.println(a + b + c);


	}

	private static int[] getMax(int a, int b, int c) {
		int[] newInput = new int[]{a, b, c};

		if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		}

		return newInput;

	}

} public 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();
		// 文字列の入力
		// String s = sc.next();
		// 出力
		// System.out11.println((a+b+c) + " " + s);

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		}


		System.out.println(a + b + c);


	}

	private static int[] getMax(int a, int b, int c) {
		int[] newInput = new int[]{a, b, c};

		if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		}

		return newInput;

	}

} Main
import java.util.Scanner;

public 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();
		// 文字列の入力
		// String s = sc.next();
		// 出力
		// System.out11.println((a+b+c) + " " + s);

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

		for (int i = 0; i < k; i++) {

			int[] result = getMax(a, b, c);
			a = result[0];
			b = result[1];
			c = result[2];

		}


		System.out.println(a + b + c);


	}

	private static int[] getMax(int a, int b, int c) {
		int[] newInput = new int[]{a, b, c};

		if (a <= b && c <= b) {
			newInput[1] = 2*b;
		} else if (b <= a && c <= a) {
			newInput[0] = 2*a;
		} else if (a <= c && b <= c) {
			newInput[2] = 2*c;
		}

		return newInput;

	}

}