#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9 * 2;

int main() {
	int a[3];
	rep(i, 3) cin >> a[i];
	int k;
	cin >> k;
	sort(a, a + 3, greater<int>());
	ll out = a[0] * pow(2, k) + a[1] + a[2];
	cout << out << endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


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