import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] a = new Integer[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.sort(a, Collections.reverseOrder());
		for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		}
		int res = 0;
		for (int i=0; i<a.length; i++) {
			res += a[i];
		}
		System.out.println(res);
	}
} import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] a = new Integer[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.sort(a, Collections.reverseOrder());
		for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		}
		int res = 0;
		for (int i=0; i<a.length; i++) {
			res += a[i];
		}
		System.out.println(res);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] a = new Integer[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.sort(a, Collections.reverseOrder());
		for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		}
		int res = 0;
		for (int i=0; i<a.length; i++) {
			res += a[i];
		}
		System.out.println(res);
	} main {
		Scanner sc = new Scanner(System.in);
		Integer[] a = new Integer[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.sort(a, Collections.reverseOrder());
		for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		}
		int res = 0;
		for (int i=0; i<a.length; i++) {
			res += a[i];
		}
		System.out.println(res);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Integer[] a = new Integer[3]; a new Integer[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 Arrays.sort(a, Collections.reverseOrder()) Arrays.sort Arrays a Collections.reverseOrder() Collections.reverseOrder Collections for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		} int i=0; int i=0; i 0 i<K i K i++ i++ i {
			a[0] = a[0]*2;
		} {
			a[0] = a[0]*2;
		} a[0] = a[0]*2 a[0] a 0 a[0]*2 a[0] a 0 2 int res = 0; res 0 for (int i=0; i<a.length; i++) {
			res += a[i];
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			res += a[i];
		} {
			res += a[i];
		} res += a[i] res a[i] a i System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] a = new Integer[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.sort(a, Collections.reverseOrder());
		for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		}
		int res = 0;
		for (int i=0; i<a.length; i++) {
			res += a[i];
		}
		System.out.println(res);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] a = new Integer[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.sort(a, Collections.reverseOrder());
		for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		}
		int res = 0;
		for (int i=0; i<a.length; i++) {
			res += a[i];
		}
		System.out.println(res);
	}
} Main
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] a = new Integer[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int K = sc.nextInt();
		Arrays.sort(a, Collections.reverseOrder());
		for (int i=0; i<K; i++) {
			a[0] = a[0]*2;
		}
		int res = 0;
		for (int i=0; i<a.length; i++) {
			res += a[i];
		}
		System.out.println(res);
	}
}
