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

public class Main {
	public static void main(String[] args) throws Exception {
		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();
		sc.close();

		Arrays.parallelSort(a);
		for (int i = 0; i < k; i++) {
			a[2] *= 2;
		}
		System.out.println(a[0] + a[1] + a[2]);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		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();
		sc.close();

		Arrays.parallelSort(a);
		for (int i = 0; i < k; i++) {
			a[2] *= 2;
		}
		System.out.println(a[0] + a[1] + a[2]);
	}
} Main public static void main(String[] args) throws Exception {
		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();
		sc.close();

		Arrays.parallelSort(a);
		for (int i = 0; i < k; i++) {
			a[2] *= 2;
		}
		System.out.println(a[0] + a[1] + a[2]);
	} 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();
		sc.close();

		Arrays.parallelSort(a);
		for (int i = 0; i < k; i++) {
			a[2] *= 2;
		}
		System.out.println(a[0] + a[1] + a[2]);
	} 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 sc.close() sc.close sc Arrays.parallelSort(a) Arrays.parallelSort Arrays a for (int i = 0; i < k; i++) {
			a[2] *= 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			a[2] *= 2;
		} {
			a[2] *= 2;
		} a[2] *= 2 a[2] a 2 2 System.out.println(a[0] + a[1] + a[2]) System.out.println System.out System System.out a[0] + a[1] + a[2] a[0] + a[1] + a[2] a[0] a 0 a[1] a 1 a[2] a 2 String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		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();
		sc.close();

		Arrays.parallelSort(a);
		for (int i = 0; i < k; i++) {
			a[2] *= 2;
		}
		System.out.println(a[0] + a[1] + a[2]);
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		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();
		sc.close();

		Arrays.parallelSort(a);
		for (int i = 0; i < k; i++) {
			a[2] *= 2;
		}
		System.out.println(a[0] + a[1] + a[2]);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		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();
		sc.close();

		Arrays.parallelSort(a);
		for (int i = 0; i < k; i++) {
			a[2] *= 2;
		}
		System.out.println(a[0] + a[1] + a[2]);
	}
}
