
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		Queue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
		
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		
		int q  = sc.nextInt();
		while(q-->0){
			pq.add(2*pq.poll());
		}
		int ans = 0;
		while(pq.size()>0){
			ans+=pq.poll();
		}
		System.out.println(ans);
		// your code goes here
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		Queue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
		
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		
		int q  = sc.nextInt();
		while(q-->0){
			pq.add(2*pq.poll());
		}
		int ans = 0;
		while(pq.size()>0){
			ans+=pq.poll();
		}
		System.out.println(ans);
		// your code goes here
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		Queue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
		
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		
		int q  = sc.nextInt();
		while(q-->0){
			pq.add(2*pq.poll());
		}
		int ans = 0;
		while(pq.size()>0){
			ans+=pq.poll();
		}
		System.out.println(ans);
		// your code goes here
	} main {
		Scanner sc = new Scanner(System.in);
		Queue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
		
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		
		int q  = sc.nextInt();
		while(q-->0){
			pq.add(2*pq.poll());
		}
		int ans = 0;
		while(pq.size()>0){
			ans+=pq.poll();
		}
		System.out.println(ans);
		// your code goes here
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Queue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder()); pq new PriorityQueue<>(Collections.reverseOrder()) pq.add(sc.nextInt()) pq.add pq sc.nextInt() sc.nextInt sc pq.add(sc.nextInt()) pq.add pq sc.nextInt() sc.nextInt sc pq.add(sc.nextInt()) pq.add pq sc.nextInt() sc.nextInt sc int q  = sc.nextInt(); q sc.nextInt() sc.nextInt sc while(q-->0){
			pq.add(2*pq.poll());
		} q-->0 q-- q 0 {
			pq.add(2*pq.poll());
		} pq.add(2*pq.poll()) pq.add pq 2*pq.poll() 2 pq.poll() pq.poll pq int ans = 0; ans 0 while(pq.size()>0){
			ans+=pq.poll();
		} pq.size()>0 pq.size() pq.size pq 0 {
			ans+=pq.poll();
		} ans+=pq.poll() ans pq.poll() pq.poll pq System.out.println(ans) System.out.println System.out System System.out ans String[] args args

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		Queue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
		
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		pq.add(sc.nextInt());
		
		int q  = sc.nextInt();
		while(q-->0){
			pq.add(2*pq.poll());
		}
		int ans = 0;
		while(pq.size()>0){
			ans+=pq.poll();
		}
		System.out.println(ans);
		// your code goes here
	}
}