#include <bits/stdc++.h>

using namespace std;

int main(){
	
	int a, b, c, k;

	scanf("%d %d %d", &a, &b, &c);
	scanf("%d", &k);

	int maxi = max(a,max(b,c));
	int total = a+b+c-maxi;
	k = 1<<k;
	total += k*maxi;

	printf("%d\n", total);

	return 0;
}