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

int main() {
  vector<int> x(3);
  int k, y;
  for(int i=0;i<3;i++) cin >> x.at(i);
  cin >> k;
  sort(x.begin(), x.end());
  y = x.at(2);
  for(int i=0;i<k;i++) y = 2*y;
  cout << x.at(0) + x.at(1) + y << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int,string>;

int main() {
 int a,b,c,k;
 cin >> a >> b >> c >> k;
 rep(i,k){
   if(max({a,b,c}) == a) a *= 2;
   else if(max({a,b,c}) == b) b *= 2;
   else c *= 2;
 }
 cout << a+ b + c << endl;
 } 