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 max;
		if(A < B) {
			max = A;
			A = B;
			B = max;
		}
		if(A < C) {
			max = A;
			A = C;
			C = max;
		}
		for(int i = 0;i < K;i++) {
			A = A * 2;
		}
		System.out.println(A+B+C);
		sc.close();
	}
} 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 max;
		if(A < B) {
			max = A;
			A = B;
			B = max;
		}
		if(A < C) {
			max = A;
			A = C;
			C = max;
		}
		for(int i = 0;i < K;i++) {
			A = A * 2;
		}
		System.out.println(A+B+C);
		sc.close();
	}
} 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 max;
		if(A < B) {
			max = A;
			A = B;
			B = max;
		}
		if(A < C) {
			max = A;
			A = C;
			C = max;
		}
		for(int i = 0;i < K;i++) {
			A = A * 2;
		}
		System.out.println(A+B+C);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();
		int max;
		if(A < B) {
			max = A;
			A = B;
			B = max;
		}
		if(A < C) {
			max = A;
			A = C;
			C = max;
		}
		for(int i = 0;i < K;i++) {
			A = A * 2;
		}
		System.out.println(A+B+C);
		sc.close();
	} 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 max; max if(A < B) {
			max = A;
			A = B;
			B = max;
		} A < B A B {
			max = A;
			A = B;
			B = max;
		} max = A max A A = B A B B = max B max if(A < C) {
			max = A;
			A = C;
			C = max;
		} A < C A C {
			max = A;
			A = C;
			C = max;
		} max = A max A A = C A C C = max C max for(int i = 0;i < K;i++) {
			A = A * 2;
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			A = A * 2;
		} {
			A = A * 2;
		} A = A * 2 A A * 2 A 2 System.out.println(A+B+C) System.out.println System.out System System.out A+B+C A+B+C A B C sc.close() sc.close sc 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 max;
		if(A < B) {
			max = A;
			A = B;
			B = max;
		}
		if(A < C) {
			max = A;
			A = C;
			C = max;
		}
		for(int i = 0;i < K;i++) {
			A = A * 2;
		}
		System.out.println(A+B+C);
		sc.close();
	}
} 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 max;
		if(A < B) {
			max = A;
			A = B;
			B = max;
		}
		if(A < C) {
			max = A;
			A = C;
			C = max;
		}
		for(int i = 0;i < K;i++) {
			A = A * 2;
		}
		System.out.println(A+B+C);
		sc.close();
	}
} 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 max;
		if(A < B) {
			max = A;
			A = B;
			B = max;
		}
		if(A < C) {
			max = A;
			A = C;
			C = max;
		}
		for(int i = 0;i < K;i++) {
			A = A * 2;
		}
		System.out.println(A+B+C);
		sc.close();
	}
}