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

int main(){
 	vector<int> a(3);
  	int k;
	cin >> a[0] >> a[1] >> a[2] >> k;
	sort(a.begin(),a.end());
  	
  	cout << a[0] + a[1] + (a[2] << k) << endl;
	
}