#include<stdio.h>
#include <iostream>
#include <algorithm>

using namespace std;


int main(int argc, char const *argv[])
{
	int a1,b,c,k;
    cin>>a1>>b>>c;
    cin>>k;
    int acum=0;
    for(int i=1;i<=k;i++){
    	int maxi=max(a1,max(b,c));
	    if(maxi==a1){a1=2*a1;acum=a1+b+c;		}
	    else if (maxi==b){b=b*2;acum=a1+b+c;}
	    else {c=c*2;acum=a1+b+c;}
	}
    cout<<acum;
   return 0;
}