import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		}
		int K = sc.nextInt();
		
		int maxIdx = 0;
		int max = data[0];
		for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		}
		
		for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		}
		
		System.out.println(data[0] + data[1] + data[2]);
		
		sc.close();

	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		}
		int K = sc.nextInt();
		
		int maxIdx = 0;
		int max = data[0];
		for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		}
		
		for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		}
		
		System.out.println(data[0] + data[1] + data[2]);
		
		sc.close();

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		}
		int K = sc.nextInt();
		
		int maxIdx = 0;
		int max = data[0];
		for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		}
		
		for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		}
		
		System.out.println(data[0] + data[1] + data[2]);
		
		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		}
		int K = sc.nextInt();
		
		int maxIdx = 0;
		int max = data[0];
		for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		}
		
		for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		}
		
		System.out.println(data[0] + data[1] + data[2]);
		
		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] data = new int[3]; data new int[3] 3 for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			data[i] = sc.nextInt();
		} {
			data[i] = sc.nextInt();
		} data[i] = sc.nextInt() data[i] data i sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int maxIdx = 0; maxIdx 0 int max = data[0]; max data[0] data 0 for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		} int i = 1; int i = 1; i 1 i < 3 i 3 i++ i++ i {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		} {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		} if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			} max < data[i] max data[i] data i {
				max = data[i];
				maxIdx = i;
			} max = data[i] max data[i] data i maxIdx = i maxIdx i for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		} int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
			data[maxIdx] *= 2;
		} {
			data[maxIdx] *= 2;
		} data[maxIdx] *= 2 data[maxIdx] data maxIdx 2 System.out.println(data[0] + data[1] + data[2]) System.out.println System.out System System.out data[0] + data[1] + data[2] data[0] + data[1] + data[2] data[0] data 0 data[1] data 1 data[2] data 2 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		}
		int K = sc.nextInt();
		
		int maxIdx = 0;
		int max = data[0];
		for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		}
		
		for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		}
		
		System.out.println(data[0] + data[1] + data[2]);
		
		sc.close();

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		}
		int K = sc.nextInt();
		
		int maxIdx = 0;
		int max = data[0];
		for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		}
		
		for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		}
		
		System.out.println(data[0] + data[1] + data[2]);
		
		sc.close();

	}

} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for(int i = 0; i < 3; i++) {
			data[i] = sc.nextInt();
		}
		int K = sc.nextInt();
		
		int maxIdx = 0;
		int max = data[0];
		for(int i = 1; i < 3; i++) {
			if(max < data[i]) {
				max = data[i];
				maxIdx = i;
			}
		}
		
		for(int i = 0; i < K; i++) {
			data[maxIdx] *= 2;
		}
		
		System.out.println(data[0] + data[1] + data[2]);
		
		sc.close();

	}

}