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

#define vi vector<int>

int solve(int k, vi& xs){
    sort(xs.begin(), xs.end()); //ordena o vector

    //xs.back() --> Returns a reference to the last element in the vector
    xs.back() *= (1<<k); // shiftar 1 vez pra esquerda eh multiplicar por 2

    return accumulate(xs.begin(), xs.end(), 0);
}

int main(){
    vi xs(3);

    for(int i=0;i<3;i++)
        cin>>xs[i];

    int k;

    cin>>k;

    auto ans = solve(k, xs);

    cout<<ans<<'\n'<<endl;

    return 0;
}
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
#include <set>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    double a , b , c , k;
    cin >> a >> b >> c >> k;
    cout << a + b + c - max( a , max( b , c ) ) + max( a , max( b , c ) ) * pow( 2 , k );
}
