import 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();
		int k = sc.nextInt();
		sc.close();

		int z = 0;

		if (a >= z) {
			z = a;
		}
		if (b >= z) {
			z = b;
		}
		if (c >= z) {
			z = c;
		}

		System.out.println(a + b + c - z + z * (int)Math.pow(2, k));
	}
} import java.util.*; util.* java 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();
		int k = sc.nextInt();
		sc.close();

		int z = 0;

		if (a >= z) {
			z = a;
		}
		if (b >= z) {
			z = b;
		}
		if (c >= z) {
			z = c;
		}

		System.out.println(a + b + c - z + z * (int)Math.pow(2, k));
	}
} 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();
		int k = sc.nextInt();
		sc.close();

		int z = 0;

		if (a >= z) {
			z = a;
		}
		if (b >= z) {
			z = b;
		}
		if (c >= z) {
			z = c;
		}

		System.out.println(a + b + c - z + z * (int)Math.pow(2, k));
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		sc.close();

		int z = 0;

		if (a >= z) {
			z = a;
		}
		if (b >= z) {
			z = b;
		}
		if (c >= z) {
			z = c;
		}

		System.out.println(a + b + c - z + z * (int)Math.pow(2, k));
	} 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 sc.close() sc.close sc int z = 0; z 0 if (a >= z) {
			z = a;
		} a >= z a z {
			z = a;
		} z = a z a if (b >= z) {
			z = b;
		} b >= z b z {
			z = b;
		} z = b z b if (c >= z) {
			z = c;
		} c >= z c z {
			z = c;
		} z = c z c System.out.println(a + b + c - z + z * (int)Math.pow(2, k)) System.out.println System.out System System.out a + b + c - z + z * (int)Math.pow(2, k) a + b + c - z a + b + c a + b + c a b c z z * (int)Math.pow(2, k) z (int)Math.pow(2, k) Math.pow Math 2 k String... args args 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();
		int k = sc.nextInt();
		sc.close();

		int z = 0;

		if (a >= z) {
			z = a;
		}
		if (b >= z) {
			z = b;
		}
		if (c >= z) {
			z = c;
		}

		System.out.println(a + b + c - z + z * (int)Math.pow(2, k));
	}
} 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();
		int k = sc.nextInt();
		sc.close();

		int z = 0;

		if (a >= z) {
			z = a;
		}
		if (b >= z) {
			z = b;
		}
		if (c >= z) {
			z = c;
		}

		System.out.println(a + b + c - z + z * (int)Math.pow(2, k));
	}
} Main
import 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();
		int k = sc.nextInt();
		sc.close();

		int z = 0;

		if (a >= z) {
			z = a;
		}
		if (b >= z) {
			z = b;
		}
		if (c >= z) {
			z = c;
		}

		System.out.println(a + b + c - z + z * (int)Math.pow(2, k));
	}
}