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();
		int powk = ((int) Math.pow(2, k));
		int answer = 0;

		if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		}

		System.out.println(answer);
  }
} 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();
		int powk = ((int) Math.pow(2, k));
		int answer = 0;

		if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		}

		System.out.println(answer);
  }
} 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 powk = ((int) Math.pow(2, k));
		int answer = 0;

		if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		}

		System.out.println(answer);
  } main {
    Scanner sc = new Scanner(System.in);
	 	int a = sc.nextInt();
 		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		int powk = ((int) Math.pow(2, k));
		int answer = 0;

		if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		}

		System.out.println(answer);
  } 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 powk = ((int) Math.pow(2, k)); powk ((int) Math.pow(2, k)) Math.pow Math 2 k int answer = 0; answer 0 if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		} a > b && a > c a > b a b a > c a c {
			answer = a * powk + b + c;
		} answer = a * powk + b + c answer a * powk + b + c a * powk + b + c a * powk a powk b c if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		} b > a && b > c b > a b a b > c b c {
			answer = b * powk + a + c;
		} answer = b * powk + a + c answer b * powk + a + c b * powk + a + c b * powk b powk a c {
			answer = c * powk + a + b;
		} answer = c * powk + a + b answer c * powk + a + b c * powk + a + b c * powk c powk a b System.out.println(answer) System.out.println System.out System System.out answer 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 powk = ((int) Math.pow(2, k));
		int answer = 0;

		if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		}

		System.out.println(answer);
  }
} 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 powk = ((int) Math.pow(2, k));
		int answer = 0;

		if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		}

		System.out.println(answer);
  }
} 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();
		int powk = ((int) Math.pow(2, k));
		int answer = 0;

		if (a > b && a > c) {
			answer = a * powk + b + c;
		} else if (b > a && b > c) {
			answer = b * powk + a + c;
		} else {
			answer = c * powk + a + b;
		}

		System.out.println(answer);
  }
}
