import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		no2();
	}

	static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		no2();
	}

	static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		}
	}
} Main public static void main(String[] args) {
		no2();
	} main {
		no2();
	} no2() no2 String[] args args static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		}
	} no2 {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		}
	} try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		} {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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 t = 0; t 0 if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			} a >= b && a >= c a >= b a b a >= c a c {
				t = b + c + (int) Math.pow(2, k) * a;
			} t = b + c + (int) Math.pow(2, k) * a t b + c + (int) Math.pow(2, k) * a b + c + (int) Math.pow(2, k) * a b c (int) Math.pow(2, k) * a (int) Math.pow(2, k) Math.pow Math 2 k a if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			} b > c && b > a b > c b c b > a b a {
				t = a + c + (int) Math.pow(2, k) * b;
			} t = a + c + (int) Math.pow(2, k) * b t a + c + (int) Math.pow(2, k) * b a + c + (int) Math.pow(2, k) * b a c (int) Math.pow(2, k) * b (int) Math.pow(2, k) Math.pow Math 2 k b if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			} c > a && c > b c > a c a c > b c b {
				t = b + a + (int) Math.pow(2, k) * c;
			} t = b + a + (int) Math.pow(2, k) * c t b + a + (int) Math.pow(2, k) * c b + a + (int) Math.pow(2, k) * c b a (int) Math.pow(2, k) * c (int) Math.pow(2, k) Math.pow Math 2 k c System.out.println(t) System.out.println System.out System System.out t public class Main {

	public static void main(String[] args) {
		no2();
	}

	static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		}
	}
} public class Main {

	public static void main(String[] args) {
		no2();
	}

	static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		no2();
	}

	static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int t = 0;
			if (a >= b && a >= c) {
				t = b + c + (int) Math.pow(2, k) * a;
			}
			if (b > c && b > a) {
				t = a + c + (int) Math.pow(2, k) * b;
			}
			if (c > a && c > b) {
				t = b + a + (int) Math.pow(2, k) * c;
			}
			System.out.println(t);
		}
	}
}
