import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int max = Math.max(a, b);
		max = Math.max(max, c);
		int ans = a + b + c - max;
		for (int i = 1; i <= k; i++) {
			max *= 2;
		}
		System.out.println(ans + max);
		sc.close();
	}
} 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 = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int max = Math.max(a, b);
		max = Math.max(max, c);
		int ans = a + b + c - max;
		for (int i = 1; i <= k; i++) {
			max *= 2;
		}
		System.out.println(ans + max);
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int max = Math.max(a, b);
		max = Math.max(max, c);
		int ans = a + b + c - max;
		for (int i = 1; i <= k; i++) {
			max *= 2;
		}
		System.out.println(ans + max);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int max = Math.max(a, b);
		max = Math.max(max, c);
		int ans = a + b + c - max;
		for (int i = 1; i <= k; i++) {
			max *= 2;
		}
		System.out.println(ans + max);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int max = Math.max(a, b); max Math.max(a, b) Math.max Math a b max = Math.max(max, c) max Math.max(max, c) Math.max Math max c int ans = a + b + c - max; ans a + b + c - max a + b + c a + b + c a b c max for (int i = 1; i <= k; i++) {
			max *= 2;
		} int i = 1; int i = 1; i 1 i <= k i k i++ i++ i {
			max *= 2;
		} {
			max *= 2;
		} max *= 2 max 2 System.out.println(ans + max) System.out.println System.out System System.out ans + max ans max sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int max = Math.max(a, b);
		max = Math.max(max, c);
		int ans = a + b + c - max;
		for (int i = 1; i <= k; i++) {
			max *= 2;
		}
		System.out.println(ans + max);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int max = Math.max(a, b);
		max = Math.max(max, c);
		int ans = a + b + c - max;
		for (int i = 1; i <= k; i++) {
			max *= 2;
		}
		System.out.println(ans + max);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		int max = Math.max(a, b);
		max = Math.max(max, c);
		int ans = a + b + c - max;
		for (int i = 1; i <= k; i++) {
			max *= 2;
		}
		System.out.println(ans + max);
		sc.close();
	}
}