import java.util.Arrays;
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int[] a = new int[3];
		
		
		for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		}
		
		
		
		Arrays.parallelSort(a);
		int cnt  = a[0]+a[1];
		int k = stdIn.nextInt();
		for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		}
		System.out.println(cnt+a[a.length-1]);
		
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int[] a = new int[3];
		
		
		for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		}
		
		
		
		Arrays.parallelSort(a);
		int cnt  = a[0]+a[1];
		int k = stdIn.nextInt();
		for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		}
		System.out.println(cnt+a[a.length-1]);
		
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int[] a = new int[3];
		
		
		for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		}
		
		
		
		Arrays.parallelSort(a);
		int cnt  = a[0]+a[1];
		int k = stdIn.nextInt();
		for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		}
		System.out.println(cnt+a[a.length-1]);
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		int[] a = new int[3];
		
		
		for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		}
		
		
		
		Arrays.parallelSort(a);
		int cnt  = a[0]+a[1];
		int k = stdIn.nextInt();
		for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		}
		System.out.println(cnt+a[a.length-1]);
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int[] a = new int[3]; a new int[3] 3 for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			a[i] = stdIn.nextInt();
		} {
			a[i] = stdIn.nextInt();
		} a[i] = stdIn.nextInt() a[i] a i stdIn.nextInt() stdIn.nextInt stdIn Arrays.parallelSort(a) Arrays.parallelSort Arrays a int cnt  = a[0]+a[1]; cnt a[0]+a[1] a[0] a 0 a[1] a 1 int k = stdIn.nextInt(); k stdIn.nextInt() stdIn.nextInt stdIn for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			a[a.length-1]*=2;
		} {
			a[a.length-1]*=2;
		} a[a.length-1]*=2 a[a.length-1] a a.length-1 a.length a a.length 1 2 System.out.println(cnt+a[a.length-1]) System.out.println System.out System System.out cnt+a[a.length-1] cnt a[a.length-1] a a.length-1 a.length a a.length 1 String[] args args public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int[] a = new int[3];
		
		
		for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		}
		
		
		
		Arrays.parallelSort(a);
		int cnt  = a[0]+a[1];
		int k = stdIn.nextInt();
		for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		}
		System.out.println(cnt+a[a.length-1]);
		
	}

} public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int[] a = new int[3];
		
		
		for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		}
		
		
		
		Arrays.parallelSort(a);
		int cnt  = a[0]+a[1];
		int k = stdIn.nextInt();
		for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		}
		System.out.println(cnt+a[a.length-1]);
		
	}

} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int[] a = new int[3];
		
		
		for(int i = 0; i < 3; i++) {
			a[i] = stdIn.nextInt();
		}
		
		
		
		Arrays.parallelSort(a);
		int cnt  = a[0]+a[1];
		int k = stdIn.nextInt();
		for(int i = 0; i < k; i++) {
			a[a.length-1]*=2;
		}
		System.out.println(cnt+a[a.length-1]);
		
	}

}
