import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt();

		int max = 0;
		int maxIndex = 0;
		for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		}

		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		}
		System.out.println(ans);

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt();

		int max = 0;
		int maxIndex = 0;
		for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		}

		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		}
		System.out.println(ans);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt();

		int max = 0;
		int maxIndex = 0;
		for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		}

		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		}
		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt();

		int max = 0;
		int maxIndex = 0;
		for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		}

		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		}
		System.out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()}; abc {sc.nextInt(),sc.nextInt(),sc.nextInt()} sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int max = 0; max 0 int maxIndex = 0; maxIndex 0 for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		} {
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		} if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			} max < abc[i] max abc[i] abc i {
				maxIndex = i;
				max = abc[i];
			} maxIndex = i maxIndex i max = abc[i] max abc[i] abc i int ans = 0; ans 0 for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		} {
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		} if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			} i == maxIndex i maxIndex {
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			} int a = abc[i]; a abc[i] abc i for(int x = 0; x < k; x++){
					a = a * 2;
				} int x = 0; int x = 0; x 0 x < k x k x++ x++ x {
					a = a * 2;
				} {
					a = a * 2;
				} a = a * 2 a a * 2 a 2 ans += a ans a {
				ans += abc[i];
			} ans += abc[i] ans abc[i] abc i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt();

		int max = 0;
		int maxIndex = 0;
		for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		}

		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		}
		System.out.println(ans);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt();

		int max = 0;
		int maxIndex = 0;
		for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		}

		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		}
		System.out.println(ans);

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] abc = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt();

		int max = 0;
		int maxIndex = 0;
		for(int i = 0; i < 3;i++){
			if(max < abc[i]){
				maxIndex = i;
				max = abc[i];
			}
		}

		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(i == maxIndex){
				int a = abc[i];
				for(int x = 0; x < k; x++){
					a = a * 2;
				}
				ans += a;
			}else{
				ans += abc[i];
			}
		}
		System.out.println(ans);

	}
}
