// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);

    ll  a,b,c,d,e,n,k,maxi=0,f=0,mini=INF,sum=0,q;
	string str,stra,straa;
    ll x,y,w,z;
    char ca,cb,cc;
    cin>>a>>b>>c>>k;
    d=max(max(a,b),c);
    e=d;
    sum=a+b+c;
    rep(i,k){
        d*=2;
    }
    cout<<sum+d-e<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)

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

  int K;
  cin >> K;

  int multi;
  for (int i = 0; i < K; i++)
  {
    multi = max(A, max(B, C)) * 2;
    if (A * 2 == multi) A = multi;
    else if (B * 2 == multi)
    {
      B = multi;
    }
    else
    {
      C = multi;
    }
    
    
  }
  
  cout << A + B + C << endl;
}