import java.util.Scanner;

public class Main {
	
	public static int check(int a,int b,int c){
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	}

} import java.util.Scanner; Scanner java.util public class Main {
	
	public static int check(int a,int b,int c){
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	}

} Main public static int check(int a,int b,int c){
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	} check {
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	} int data; data if(a>=b)data=a;
		else data=b; a>=b a b data=a data a data=b data b if(data>=c){}
		else data=c; data>=c data c {} data=c data c return data; data int a a int b b int c c public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	} main {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	} Scanner s=new Scanner(System.in); s new Scanner(System.in) int A=s.nextInt(); A s.nextInt() s.nextInt s int B=s.nextInt(); B s.nextInt() s.nextInt s int C=s.nextInt(); C s.nextInt() s.nextInt s int K=s.nextInt(); K s.nextInt() s.nextInt s int d; d int all=0; all 0 d=Main.check(A,B,C) d Main.check(A,B,C) Main.check Main A B C if(d==A)all=B+C; d==A d A all=B+C all B+C B C if(d==B)all=A+C; d==B d B all=A+C all A+C A C if(d==C)all=B+A; d==C d C all=B+A all B+A B A for(int i=0;i<K;i++){
			d*=2;
		} int i=0; int i=0; i 0 i<K i K i++ i++ i {
			d*=2;
		} {
			d*=2;
		} d*=2 d 2 System.out.print(all+d) System.out.print System.out System System.out all+d all d String[] args args public class Main {
	
	public static int check(int a,int b,int c){
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	}

} public class Main {
	
	public static int check(int a,int b,int c){
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	}

} Main
import java.util.Scanner;

public class Main {
	
	public static int check(int a,int b,int c){
		int data;
		
		if(a>=b)data=a;
		else data=b;
		if(data>=c){}
		else data=c;
		
		return data;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int A=s.nextInt();
		int B=s.nextInt();
		int C=s.nextInt();
		int K=s.nextInt();
		int d;
		int all=0;
		
		d=Main.check(A,B,C);
		if(d==A)all=B+C;
		if(d==B)all=A+C;
		if(d==C)all=B+A;
		for(int i=0;i<K;i++){
			d*=2;
		}
		System.out.print(all+d);

	}

}
