import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a[] = new int[3];
		for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		int max = 0;
		int mid = 0;
		int sum = 0;
		for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		}
		mid = max;
		for(int i=1;i<=k;i++) {
			mid = mid * 2;
		}
		sum = mid + a[0] + a[1] + a[2] - max;
		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a[] = new int[3];
		for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		int max = 0;
		int mid = 0;
		int sum = 0;
		for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		}
		mid = max;
		for(int i=1;i<=k;i++) {
			mid = mid * 2;
		}
		sum = mid + a[0] + a[1] + a[2] - max;
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a[] = new int[3];
		for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		int max = 0;
		int mid = 0;
		int sum = 0;
		for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		}
		mid = max;
		for(int i=1;i<=k;i++) {
			mid = mid * 2;
		}
		sum = mid + a[0] + a[1] + a[2] - max;
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int a[] = new int[3];
		for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		int max = 0;
		int mid = 0;
		int sum = 0;
		for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		}
		mid = max;
		for(int i=1;i<=k;i++) {
			mid = mid * 2;
		}
		sum = mid + a[0] + a[1] + a[2] - max;
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a[] = new int[3]; a new int[3] 3 for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
			a[i] = sc.nextInt();
		} {
			a[i] = sc.nextInt();
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int max = 0; max 0 int mid = 0; mid 0 int sum = 0; sum 0 for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		} int i=0; int i=0; i 0 i<a.length-1 i a.length-1 a.length a a.length 1 i++ i++ i {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		} {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		} if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			} a[i]<a[i+1] a[i] a i a[i+1] a i+1 i 1 {
				max = a[i+1];
			} max = a[i+1] max a[i+1] a i+1 i 1 {
				max = a[i];
			} max = a[i] max a[i] a i mid = max mid max for(int i=1;i<=k;i++) {
			mid = mid * 2;
		} int i=1; int i=1; i 1 i<=k i k i++ i++ i {
			mid = mid * 2;
		} {
			mid = mid * 2;
		} mid = mid * 2 mid mid * 2 mid 2 sum = mid + a[0] + a[1] + a[2] - max sum mid + a[0] + a[1] + a[2] - max mid + a[0] + a[1] + a[2] a[1] mid + a[0] + a[1] + a[2] mid a[0] a 0 a[1] a 1 a[2] a 2 max System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a[] = new int[3];
		for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		int max = 0;
		int mid = 0;
		int sum = 0;
		for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		}
		mid = max;
		for(int i=1;i<=k;i++) {
			mid = mid * 2;
		}
		sum = mid + a[0] + a[1] + a[2] - max;
		System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a[] = new int[3];
		for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		int max = 0;
		int mid = 0;
		int sum = 0;
		for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		}
		mid = max;
		for(int i=1;i<=k;i++) {
			mid = mid * 2;
		}
		sum = mid + a[0] + a[1] + a[2] - max;
		System.out.println(sum);
	}
} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a[] = new int[3];
		for(int i=0;i<a.length;i++) {
			a[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		int max = 0;
		int mid = 0;
		int sum = 0;
		for(int i=0;i<a.length-1;i++) {
			if(a[i]<a[i+1]) {
				max = a[i+1];
			}else {
				max = a[i];
			}
		}
		mid = max;
		for(int i=1;i<=k;i++) {
			mid = mid * 2;
		}
		sum = mid + a[0] + a[1] + a[2] - max;
		System.out.println(sum);
	}
}
