#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}


int main(){FIN
    vll a(3); REP(i,3) cin>>a[i];
    ll k;cin>>k;
    VSORTR(a);
    a[0] *= power(2,k);
    cout<<a[0]+a[1]+a[2]<<endl;
    

    return 0;
}

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

int main() {
    int a, b, c, k, tem, ans;
    
    cin >> a >> b >> c >> k;
    ans = a + b + c - max({a, b, c});
    
    tem = max({a, b, c});
    for ( int i = 0; i < k; i++ ) {
        tem *= 2;
    }
    cout << ans + tem << endl;
    
    return (0);
}