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

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

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

		int d = Math.max(a, Math.max(b, c));
		if (d == a) {
			for(int i = 0;i < k; i++) {
				d *= 2;
			}
			System.out.println(d + b + c);
		}else if (d == b) {
			for(int i = 0;i < k; i++) {
				d *= 2;
			}
			System.out.println(d + a + c);
		}else {
			for(int i = 0;i < k; i++) {
				d *= 2;
			}
			System.out.println(d + a + b);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();

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

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

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

		int d = Math.max(a, Math.max(b, c));
		if (d == a) {
			for(int i = 0;i < k; i++) {
				d *= 2;
			}
			System.out.println(d + b + c);
		}else if (d == b) {
			for(int i = 0;i < k; i++) {
				d *= 2;
			}
			System.out.println(d + a + c);
		}else {
			for(int i = 0;i < k; i++) {
				d *= 2;
			}
			System.out.println(d + a + b);
		}
	}
}
