import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		int max;
		int tmp;
		
		if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		}
		
		tmp = max;
		
		for (int i = 0; i < k; i++) {
			tmp *= 2;
		}
		
		System.out.println(tmp + a + b + c - max);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[]) {
		
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		int max;
		int tmp;
		
		if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		}
		
		tmp = max;
		
		for (int i = 0; i < k; i++) {
			tmp *= 2;
		}
		
		System.out.println(tmp + a + b + c - max);
	}
} Main public static void main(String args[]) {
		
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		int max;
		int tmp;
		
		if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		}
		
		tmp = max;
		
		for (int i = 0; i < k; i++) {
			tmp *= 2;
		}
		
		System.out.println(tmp + a + b + c - max);
	} main {
		
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		int max;
		int tmp;
		
		if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		}
		
		tmp = max;
		
		for (int i = 0; i < k; i++) {
			tmp *= 2;
		}
		
		System.out.println(tmp + a + b + c - max);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int max; max int tmp; tmp if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		} a > b && a > c a > b a b a > c a c {
			max = a;
		} max = a max a if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		} b > a && b > c b > a b a b > c b c {
			max = b;
		} max = b max b {
			max = c;
		} max = c max c tmp = max tmp max for (int i = 0; i < k; i++) {
			tmp *= 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			tmp *= 2;
		} {
			tmp *= 2;
		} tmp *= 2 tmp 2 System.out.println(tmp + a + b + c - max) System.out.println System.out System System.out tmp + a + b + c - max tmp + a + b + c b tmp + a + b + c tmp a b c max String args[] args public class Main {

	public static void main(String args[]) {
		
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		int max;
		int tmp;
		
		if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		}
		
		tmp = max;
		
		for (int i = 0; i < k; i++) {
			tmp *= 2;
		}
		
		System.out.println(tmp + a + b + c - max);
	}
} public class Main {

	public static void main(String args[]) {
		
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		int max;
		int tmp;
		
		if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		}
		
		tmp = max;
		
		for (int i = 0; i < k; i++) {
			tmp *= 2;
		}
		
		System.out.println(tmp + a + b + c - max);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		int max;
		int tmp;
		
		if (a > b && a > c) {
			max = a;
		} else if (b > a && b > c) {
			max = b;
		} else {
			max = c;
		}
		
		tmp = max;
		
		for (int i = 0; i < k; i++) {
			tmp *= 2;
		}
		
		System.out.println(tmp + a + b + c - max);
	}
}