import java.util.Scanner;

public class Main {
	
	public static int check(int a,int b,int c){
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	}

}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz