import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		int A=sc.nextInt();
		int B=sc.nextInt();
		int C=sc.nextInt();
		int K=sc.nextInt();
		int A2=A;
		int B2=B;
		int C2=C;
		for(int i=0;i<K;i++) {
			A2=A2*2;
		}
		int A3=A2+B+C;
		for(int i=0;i<K;i++) {
			B2=B2*2;
		}
		int B3=A+B2+C;
		for(int i=0;i<K;i++) {
			C2=C2*2;
		}
		int C3=A+B+C2;
		int max=A3;
		if(max<B3) {
			max=B3;
		}
		if(max<C3) {
			max=C3;
		}
		System.out.println(max);
	}
}
/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