import java.util.*;

public class Main{

    public static void main(String[] args){

	Scanner sc = new Scanner(System.in);
	int[] table = new int[3];
	int temp = 0;
	
	for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	}
	
	int k = sc.nextInt();

	for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	}


      	for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	}

	int sum = 0;

	for(int i=0;i<3;i++){
	
	    sum = sum + table[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[] table = new int[3];
	int temp = 0;
	
	for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	}
	
	int k = sc.nextInt();

	for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	}


      	for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	}

	int sum = 0;

	for(int i=0;i<3;i++){
	
	    sum = sum + table[i];
	}
      	System.out.println(sum);
    }
} Main public static void main(String[] args){

	Scanner sc = new Scanner(System.in);
	int[] table = new int[3];
	int temp = 0;
	
	for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	}
	
	int k = sc.nextInt();

	for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	}


      	for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	}

	int sum = 0;

	for(int i=0;i<3;i++){
	
	    sum = sum + table[i];
	}
      	System.out.println(sum);
    } main {

	Scanner sc = new Scanner(System.in);
	int[] table = new int[3];
	int temp = 0;
	
	for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	}
	
	int k = sc.nextInt();

	for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	}


      	for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	}

	int sum = 0;

	for(int i=0;i<3;i++){
	
	    sum = sum + table[i];
	}
      	System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] table = new int[3]; table new int[3] 3 int temp = 0; temp 0 for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
	    table[i] = sc.nextInt();
	} {
	    table[i] = sc.nextInt();
	} table[i] = sc.nextInt() table[i] table i sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	} int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	} {
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	} for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    } int j=i+1; int j=i+1; j i+1 i 1 j<3 j 3 j++ j++ j {
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    } {
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    } if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		} table[i]<table[j] table[i] table i table[j] table j {
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		} temp = table[i] temp table[i] table i table[i] = table[j] table[i] table i table[j] table j table[j] = temp table[j] table j temp for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	} int j=0; int j=0; j 0 j<k j k j++ j++ j {
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	} {
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	} if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		} table[0]>table[1] table[0] table 0 table[1] table 1 {
		    table[0] = table[0] * 2;
		} table[0] = table[0] * 2 table[0] table 0 table[0] * 2 table[0] table 0 2 {
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		} table[1] = table[1]*2 table[1] table 1 table[1]*2 table[1] table 1 2 temp = table[0] temp table[0] table 0 table[0] = table[1] table[0] table 0 table[1] table 1 table[1] = temp table[1] table 1 temp int sum = 0; sum 0 for(int i=0;i<3;i++){
	
	    sum = sum + table[i];
	} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
	
	    sum = sum + table[i];
	} {
	
	    sum = sum + table[i];
	} sum = sum + table[i] sum sum + table[i] sum table[i] table 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[] table = new int[3];
	int temp = 0;
	
	for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	}
	
	int k = sc.nextInt();

	for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	}


      	for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	}

	int sum = 0;

	for(int i=0;i<3;i++){
	
	    sum = sum + table[i];
	}
      	System.out.println(sum);
    }
} public class Main{

    public static void main(String[] args){

	Scanner sc = new Scanner(System.in);
	int[] table = new int[3];
	int temp = 0;
	
	for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	}
	
	int k = sc.nextInt();

	for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	}


      	for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	}

	int sum = 0;

	for(int i=0;i<3;i++){
	
	    sum = sum + table[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[] table = new int[3];
	int temp = 0;
	
	for(int i=0;i<3;i++){
	    table[i] = sc.nextInt();
	}
	
	int k = sc.nextInt();

	for(int i=0;i<2;i++){
	    
	    for(int j=i+1;j<3;j++){
		if(table[i]<table[j]){
		    temp = table[i];
		    table[i] = table[j];
		    table[j] = temp;
		}
	    }
	}


      	for(int j=0;j<k;j++){
	    
		if(table[0]>table[1]){
		    table[0] = table[0] * 2;
		}else{
		    table[1] = table[1]*2;
		    temp = table[0];
		    table[0] = table[1];
		    table[1] = temp;
		}
	    
	}

	int sum = 0;

	for(int i=0;i<3;i++){
	
	    sum = sum + table[i];
	}
      	System.out.println(sum);
    }
}
