import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		int max = Math.max(a,Math.max(b,c));
		int ans = a+b+c-max;
		ans += max*(int)Math.pow(2,sc.nextDouble());
		System.out.println(ans);
		sc.close();
	}
} 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(), b = sc.nextInt(), c = sc.nextInt();
		int max = Math.max(a,Math.max(b,c));
		int ans = a+b+c-max;
		ans += max*(int)Math.pow(2,sc.nextDouble());
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		int max = Math.max(a,Math.max(b,c));
		int ans = a+b+c-max;
		ans += max*(int)Math.pow(2,sc.nextDouble());
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		int max = Math.max(a,Math.max(b,c));
		int ans = a+b+c-max;
		ans += max*(int)Math.pow(2,sc.nextDouble());
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int max = Math.max(a,Math.max(b,c)); max Math.max(a,Math.max(b,c)) Math.max Math a Math.max(b,c) Math.max Math b c int ans = a+b+c-max; ans a+b+c-max a+b+c a+b+c a b c max ans += max*(int)Math.pow(2,sc.nextDouble()) ans max*(int)Math.pow(2,sc.nextDouble()) max (int)Math.pow(2,sc.nextDouble()) Math.pow Math 2 sc.nextDouble() sc.nextDouble sc System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		int max = Math.max(a,Math.max(b,c));
		int ans = a+b+c-max;
		ans += max*(int)Math.pow(2,sc.nextDouble());
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		int max = Math.max(a,Math.max(b,c));
		int ans = a+b+c-max;
		ans += max*(int)Math.pow(2,sc.nextDouble());
		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		int max = Math.max(a,Math.max(b,c));
		int ans = a+b+c-max;
		ans += max*(int)Math.pow(2,sc.nextDouble());
		System.out.println(ans);
		sc.close();
	}
}