#include <bits/stdc++.h>
using namespace std;
int main() {
    int k, sum=0;
	vector<int> v1(3);
	for(int i=0;i<3;i++)
	{
	    cin>>v1[i];
	}
		cin>>k;
	sort(v1.begin(),v1.end());
	for(int i=1;i<=k;i++){
	v1[2]=v1[2]*2;}
	for(int i=0;i<3;i++)
	{
	    sum+=v1[i];
	}
    cout<<sum<<"\n";
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
 vector<int>v;
 int a,b,c,k;
 cin >> a >> b >> c >> k;
 v.push_back(a);
 v.push_back(b);
 v.push_back(c);
 int sum = 0;
 while(k--)
 {
     sort(v.begin(),v.end());
     v[2]*=2;

 }

 sum = v[0] + v[1] + v[2];
 cout << sum << endl;


}
