#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int MOD = 1e9+7;
using ll = long long;
using vi = vector<int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(x) x.begin(), x.end()

int main() {
  vi a(3);
  rep(i,3){
    cin >> a.at(i);
  }
  sort(ALL(a));
  int b,ans=0;
  cin >> b;
  rep(i,b){
    a.at(2)*=2;
  }
  cout << a.at(0)+a.at(1)+a.at(2);
}
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	int A, B, C, K;
	cin >> A >> B >> C >> K;

	vector<int> v(3);
	v.at(0) = A;
	v.at(1) = B;
	v.at(2) = C;
	sort(v.begin(), v.end());

	int n = v.back();
	while (K) {
		n *= 2;
		K--;
	}

	cout << v.at(0) + v.at(1) + n << endl;
}