import java.util.Scanner;
//import java.util.Arrays;
public 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 k = sc.nextInt();
		int max = 0;
		if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		}
		for(int i=0; i<k; i++){
			max *= 2;
		}
		System.out.println(a + b + c + max);
	}
} import java.util.Scanner; Scanner java.util public 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 k = sc.nextInt();
		int max = 0;
		if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		}
		for(int i=0; i<k; i++){
			max *= 2;
		}
		System.out.println(a + b + c + max);
	}
} 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 k = sc.nextInt();
		int max = 0;
		if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		}
		for(int i=0; i<k; i++){
			max *= 2;
		}
		System.out.println(a + b + c + max);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		int max = 0;
		if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		}
		for(int i=0; i<k; i++){
			max *= 2;
		}
		System.out.println(a + b + c + max);
	} 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 k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int max = 0; max 0 if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		} a >= b && a >= c a >= b a b a >= c a c {
			max = a;
			a = 0;
		} max = a max a a = 0 a 0 if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		} b >= c b c {
			max = b;
			b = 0;
		} max = b max b b = 0 b 0 {
			max = c;
			c = 0;
		} max = c max c c = 0 c 0 for(int i=0; i<k; i++){
			max *= 2;
		} int i=0; int i=0; i 0 i<k i k i++ i++ i {
			max *= 2;
		} {
			max *= 2;
		} max *= 2 max 2 System.out.println(a + b + c + max) System.out.println System.out System System.out a + b + c + max c a + b + c + max a b c max String[] args args public 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 k = sc.nextInt();
		int max = 0;
		if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		}
		for(int i=0; i<k; i++){
			max *= 2;
		}
		System.out.println(a + b + c + max);
	}
} public 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 k = sc.nextInt();
		int max = 0;
		if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		}
		for(int i=0; i<k; i++){
			max *= 2;
		}
		System.out.println(a + b + c + max);
	}
} Main
import java.util.Scanner;
//import java.util.Arrays;
public 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 k = sc.nextInt();
		int max = 0;
		if(a >= b && a >= c){
			max = a;
			a = 0;
		}else if(b >= c){
			max = b;
			b = 0;
		}else{
			max = c;
			c = 0;
		}
		for(int i=0; i<k; i++){
			max *= 2;
		}
		System.out.println(a + b + c + max);
	}
}
