import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), b = sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
		int sum=0,count=1,flag=0,max=-999999,min=99999;
		int[] array=new int[10000];
		//String[] array = new String[n];
		//String s=sc.next();//,t=sc.next();
		array[0]=n;
		array[1]=b;
		array[2]=c;
		Arrays.sort(array);
		array[9999]=(int) (Math.pow(2, k)*array[9999]);
		for(int i=9999;i>=0;i--) {
			sum+=array[i];
		}
		System.out.println(sum);
	}
	public static int sample(int n) {
		return n;
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), b = sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
		int sum=0,count=1,flag=0,max=-999999,min=99999;
		int[] array=new int[10000];
		//String[] array = new String[n];
		//String s=sc.next();//,t=sc.next();
		array[0]=n;
		array[1]=b;
		array[2]=c;
		Arrays.sort(array);
		array[9999]=(int) (Math.pow(2, k)*array[9999]);
		for(int i=9999;i>=0;i--) {
			sum+=array[i];
		}
		System.out.println(sum);
	}
	public static int sample(int n) {
		return n;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), b = sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
		int sum=0,count=1,flag=0,max=-999999,min=99999;
		int[] array=new int[10000];
		//String[] array = new String[n];
		//String s=sc.next();//,t=sc.next();
		array[0]=n;
		array[1]=b;
		array[2]=c;
		Arrays.sort(array);
		array[9999]=(int) (Math.pow(2, k)*array[9999]);
		for(int i=9999;i>=0;i--) {
			sum+=array[i];
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), b = sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
		int sum=0,count=1,flag=0,max=-999999,min=99999;
		int[] array=new int[10000];
		//String[] array = new String[n];
		//String s=sc.next();//,t=sc.next();
		array[0]=n;
		array[1]=b;
		array[2]=c;
		Arrays.sort(array);
		array[9999]=(int) (Math.pow(2, k)*array[9999]);
		for(int i=9999;i>=0;i--) {
			sum+=array[i];
		}
		System.out.println(sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc c=sc.nextInt() c sc.nextInt() sc.nextInt sc k=sc.nextInt(); k sc.nextInt() sc.nextInt sc int sum=0 sum 0 count=1 count 1 flag=0 flag 0 max=-999999 max -999999 999999 min=99999; min 99999 int[] array=new int[10000]; array new int[10000] 10000 array[0]=n array[0] array 0 n array[1]=b array[1] array 1 b array[2]=c array[2] array 2 c Arrays.sort(array) Arrays.sort Arrays array array[9999]=(int) (Math.pow(2, k)*array[9999]) array[9999] array 9999 (int) (Math.pow(2, k)*array[9999]) Math.pow(2, k) Math.pow Math 2 k array[9999] array 9999 for(int i=9999;i>=0;i--) {
			sum+=array[i];
		} int i=9999; int i=9999; i 9999 i>=0 i 0 i-- i-- i {
			sum+=array[i];
		} {
			sum+=array[i];
		} sum+=array[i] sum array[i] array i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static int sample(int n) {
		return n;
	} sample {
		return n;
	} return n; n int n n public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), b = sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
		int sum=0,count=1,flag=0,max=-999999,min=99999;
		int[] array=new int[10000];
		//String[] array = new String[n];
		//String s=sc.next();//,t=sc.next();
		array[0]=n;
		array[1]=b;
		array[2]=c;
		Arrays.sort(array);
		array[9999]=(int) (Math.pow(2, k)*array[9999]);
		for(int i=9999;i>=0;i--) {
			sum+=array[i];
		}
		System.out.println(sum);
	}
	public static int sample(int n) {
		return n;
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), b = sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
		int sum=0,count=1,flag=0,max=-999999,min=99999;
		int[] array=new int[10000];
		//String[] array = new String[n];
		//String s=sc.next();//,t=sc.next();
		array[0]=n;
		array[1]=b;
		array[2]=c;
		Arrays.sort(array);
		array[9999]=(int) (Math.pow(2, k)*array[9999]);
		for(int i=9999;i>=0;i--) {
			sum+=array[i];
		}
		System.out.println(sum);
	}
	public static int sample(int n) {
		return n;
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), b = sc.nextInt(),c=sc.nextInt(),k=sc.nextInt();
		int sum=0,count=1,flag=0,max=-999999,min=99999;
		int[] array=new int[10000];
		//String[] array = new String[n];
		//String s=sc.next();//,t=sc.next();
		array[0]=n;
		array[1]=b;
		array[2]=c;
		Arrays.sort(array);
		array[9999]=(int) (Math.pow(2, k)*array[9999]);
		for(int i=9999;i>=0;i--) {
			sum+=array[i];
		}
		System.out.println(sum);
	}
	public static int sample(int n) {
		return n;
	}

}
