import java.util.*;
class Main{

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int num;
		int sum = a + b + c;
		if(a>b){
			num = a;
		}else{
			num = b;
		}
		if(c>num){
			num = c;
		}
		sum = sum - num;
		for(int y=0; y<x; y++){
			num = num * 2;
		}
		System.out.println(num + sum);
	}
} import java.util.*; util.* java class Main{

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int num;
		int sum = a + b + c;
		if(a>b){
			num = a;
		}else{
			num = b;
		}
		if(c>num){
			num = c;
		}
		sum = sum - num;
		for(int y=0; y<x; y++){
			num = num * 2;
		}
		System.out.println(num + sum);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int num;
		int sum = a + b + c;
		if(a>b){
			num = a;
		}else{
			num = b;
		}
		if(c>num){
			num = c;
		}
		sum = sum - num;
		for(int y=0; y<x; y++){
			num = num * 2;
		}
		System.out.println(num + sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int num;
		int sum = a + b + c;
		if(a>b){
			num = a;
		}else{
			num = b;
		}
		if(c>num){
			num = c;
		}
		sum = sum - num;
		for(int y=0; y<x; y++){
			num = num * 2;
		}
		System.out.println(num + sum);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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 x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int num; num int sum = a + b + c; sum a + b + c a + b + c a b c if(a>b){
			num = a;
		}else{
			num = b;
		} a>b a b {
			num = a;
		} num = a num a {
			num = b;
		} num = b num b if(c>num){
			num = c;
		} c>num c num {
			num = c;
		} num = c num c sum = sum - num sum sum - num sum num for(int y=0; y<x; y++){
			num = num * 2;
		} int y=0; int y=0; y 0 y<x y x y++ y++ y {
			num = num * 2;
		} {
			num = num * 2;
		} num = num * 2 num num * 2 num 2 System.out.println(num + sum) System.out.println System.out System System.out num + sum num sum String[] args args
import java.util.*;
class Main{

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int num;
		int sum = a + b + c;
		if(a>b){
			num = a;
		}else{
			num = b;
		}
		if(c>num){
			num = c;
		}
		sum = sum - num;
		for(int y=0; y<x; y++){
			num = num * 2;
		}
		System.out.println(num + sum);
	}
}
