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

int main(void) {
    int a,b,c,k;
    int64_t target;
    int64_t remains;
    cin >> a >> b >> c >> k;
    target = max(a,max(b,c)); 
    remains = a + b + c - target;
    target = target * pow(2,k);
    cout << target + remains << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    double n, x, t;
    cin>>n>>x>>t;
    double t1 = ceil(double(n/x));
    //cout<<n/x<<endl;
    //cout<<t1<<endl;
    ll t11 = ll(t1)*ll(t);
    cout<<t11<<endl;

}
