import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		double c = sc.nextInt();
		int k = sc.nextInt();

		double d = Math.max(a, b);
		if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		}

		System.out.println((int)Math.min(a,b) + (int)d + (int)c);


	}

} 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();
		int b = sc.nextInt();
		double c = sc.nextInt();
		int k = sc.nextInt();

		double d = Math.max(a, b);
		if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		}

		System.out.println((int)Math.min(a,b) + (int)d + (int)c);


	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		double c = sc.nextInt();
		int k = sc.nextInt();

		double d = Math.max(a, b);
		if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		}

		System.out.println((int)Math.min(a,b) + (int)d + (int)c);


	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		double c = sc.nextInt();
		int k = sc.nextInt();

		double d = Math.max(a, b);
		if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		}

		System.out.println((int)Math.min(a,b) + (int)d + (int)c);


	} 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 double c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc double d = Math.max(a, b); d Math.max(a, b) Math.max Math a b if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		} d > c d c {
			d = d * Math.pow(2, k);
		} d = d * Math.pow(2, k) d d * Math.pow(2, k) d Math.pow(2, k) Math.pow Math 2 k {
			c = c * Math.pow(2, k);
		} c = c * Math.pow(2, k) c c * Math.pow(2, k) c Math.pow(2, k) Math.pow Math 2 k System.out.println((int)Math.min(a,b) + (int)d + (int)c) System.out.println System.out System System.out (int)Math.min(a,b) + (int)d + (int)c (int)Math.min(a,b) + (int)d + (int)c (int)Math.min(a,b) Math.min Math a b (int)d (int)c 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();
		double c = sc.nextInt();
		int k = sc.nextInt();

		double d = Math.max(a, b);
		if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		}

		System.out.println((int)Math.min(a,b) + (int)d + (int)c);


	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		double c = sc.nextInt();
		int k = sc.nextInt();

		double d = Math.max(a, b);
		if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		}

		System.out.println((int)Math.min(a,b) + (int)d + (int)c);


	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		double c = sc.nextInt();
		int k = sc.nextInt();

		double d = Math.max(a, b);
		if(d > c) {
			d = d * Math.pow(2, k);
		}else {
			c = c * Math.pow(2, k);
		}

		System.out.println((int)Math.min(a,b) + (int)d + (int)c);


	}

}
