import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	Scanner sc = new Scanner(System.in);
	int n;
	public void run(){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		solve(a, b, c, k);
	}
	public void solve(int a, int b, int c, int k){
		int ans = a + b + c;
		int t = a;
		if(t < b) t = b;
		if(t < c) t = c;
		
		ans = ans - t;
		
		for (int i = 0; i < k; i++){
			t = t * 2;
		}
		
		ans = ans + t;
		
		System.out.println(ans);
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
	Scanner sc = new Scanner(System.in);
	int n;
	public void run(){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		solve(a, b, c, k);
	}
	public void solve(int a, int b, int c, int k){
		int ans = a + b + c;
		int t = a;
		if(t < b) t = b;
		if(t < c) t = c;
		
		ans = ans - t;
		
		for (int i = 0; i < k; i++){
			t = t * 2;
		}
		
		ans = ans + t;
		
		System.out.println(ans);
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n; n public void run(){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		solve(a, b, c, k);
	} run {
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		solve(a, b, c, k);
	} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc solve(a, b, c, k) solve a b c k public void solve(int a, int b, int c, int k){
		int ans = a + b + c;
		int t = a;
		if(t < b) t = b;
		if(t < c) t = c;
		
		ans = ans - t;
		
		for (int i = 0; i < k; i++){
			t = t * 2;
		}
		
		ans = ans + t;
		
		System.out.println(ans);
	} solve {
		int ans = a + b + c;
		int t = a;
		if(t < b) t = b;
		if(t < c) t = c;
		
		ans = ans - t;
		
		for (int i = 0; i < k; i++){
			t = t * 2;
		}
		
		ans = ans + t;
		
		System.out.println(ans);
	} int ans = a + b + c; ans a + b + c a + b + c a b c int t = a; t a if(t < b) t = b; t < b t b t = b t b if(t < c) t = c; t < c t c t = c t c ans = ans - t ans ans - t ans t for (int i = 0; i < k; i++){
			t = t * 2;
		} int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
			t = t * 2;
		} {
			t = t * 2;
		} t = t * 2 t t * 2 t 2 ans = ans + t ans ans + t ans t System.out.println(ans) System.out.println System.out System System.out ans int a a int b b int c c int k k public static void main(String[] args){
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    } Pair int first first second; second public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        } Pair {
            this.first = a;
            this.second = b;
        } this.first = a this.first this this.first a this.second = b this.second this this.second b int a a int b b public class Main {
	Scanner sc = new Scanner(System.in);
	int n;
	public void run(){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		solve(a, b, c, k);
	}
	public void solve(int a, int b, int c, int k){
		int ans = a + b + c;
		int t = a;
		if(t < b) t = b;
		if(t < c) t = c;
		
		ans = ans - t;
		
		for (int i = 0; i < k; i++){
			t = t * 2;
		}
		
		ans = ans + t;
		
		System.out.println(ans);
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} public class Main {
	Scanner sc = new Scanner(System.in);
	int n;
	public void run(){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		solve(a, b, c, k);
	}
	public void solve(int a, int b, int c, int k){
		int ans = a + b + c;
		int t = a;
		if(t < b) t = b;
		if(t < c) t = c;
		
		ans = ans - t;
		
		for (int i = 0; i < k; i++){
			t = t * 2;
		}
		
		ans = ans + t;
		
		System.out.println(ans);
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
} Main
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	Scanner sc = new Scanner(System.in);
	int n;
	public void run(){
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		solve(a, b, c, k);
	}
	public void solve(int a, int b, int c, int k){
		int ans = a + b + c;
		int t = a;
		if(t < b) t = b;
		if(t < c) t = c;
		
		ans = ans - t;
		
		for (int i = 0; i < k; i++){
			t = t * 2;
		}
		
		ans = ans + t;
		
		System.out.println(ans);
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
	static class Pair {
        int first,second;
        public Pair(int a,int b) {
            this.first = a;
            this.second = b;
        }
    }	
}
