import java.util.*;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int [] a = new int[3];
		int ind = 0;
		int max = 0;
		int sum = 0;
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		}
		int k = sc.nextInt();
		for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		}
		for(int i = 0; i < 3; i++) {
			sum += a[i];
		}
		System.out.println(sum);
		sc.close();
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int [] a = new int[3];
		int ind = 0;
		int max = 0;
		int sum = 0;
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		}
		int k = sc.nextInt();
		for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		}
		for(int i = 0; i < 3; i++) {
			sum += a[i];
		}
		System.out.println(sum);
		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int [] a = new int[3];
		int ind = 0;
		int max = 0;
		int sum = 0;
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		}
		int k = sc.nextInt();
		for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		}
		for(int i = 0; i < 3; i++) {
			sum += a[i];
		}
		System.out.println(sum);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int [] a = new int[3];
		int ind = 0;
		int max = 0;
		int sum = 0;
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		}
		int k = sc.nextInt();
		for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		}
		for(int i = 0; i < 3; i++) {
			sum += a[i];
		}
		System.out.println(sum);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int [] a = new int[3]; a new int[3] 3 int ind = 0; ind 0 int max = 0; max 0 int sum = 0; sum 0 for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		} {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i] > max) {
				max = a[i];
				ind = i;
			} a[i] > max a[i] a i max {
				max = a[i];
				ind = i;
			} max = a[i] max a[i] a i ind = i ind i int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			a[ind] += a[ind];
		} {
			a[ind] += a[ind];
		} a[ind] += a[ind] a[ind] a ind a[ind] a ind for(int i = 0; i < 3; i++) {
			sum += a[i];
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			sum += a[i];
		} {
			sum += a[i];
		} sum += a[i] sum a[i] a i System.out.println(sum) System.out.println System.out System System.out sum 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 = new int[3];
		int ind = 0;
		int max = 0;
		int sum = 0;
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		}
		int k = sc.nextInt();
		for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		}
		for(int i = 0; i < 3; i++) {
			sum += a[i];
		}
		System.out.println(sum);
		sc.close();
	}

} public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int [] a = new int[3];
		int ind = 0;
		int max = 0;
		int sum = 0;
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		}
		int k = sc.nextInt();
		for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		}
		for(int i = 0; i < 3; i++) {
			sum += a[i];
		}
		System.out.println(sum);
		sc.close();
	}

} Main
import java.util.*;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int [] a = new int[3];
		int ind = 0;
		int max = 0;
		int sum = 0;
		for(int i = 0; i < 3; i++) {
			a[i] = sc.nextInt();
			if(a[i] > max) {
				max = a[i];
				ind = i;
			}
		}
		int k = sc.nextInt();
		for(int i = 0; i < k; i++) {
			a[ind] += a[ind];
		}
		for(int i = 0; i < 3; i++) {
			sum += a[i];
		}
		System.out.println(sum);
		sc.close();
	}

}
