import java.util.*;
public class Main {

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

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

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

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