import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] ary = new int[3];
		
		for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		}
		in.nextLine();
		int k = in.nextInt();
		
		Arrays.sort(ary);
		
		for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		}
		
		int fin = 0;
		for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		}
		
		System.out.println(fin);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] ary = new int[3];
		
		for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		}
		in.nextLine();
		int k = in.nextInt();
		
		Arrays.sort(ary);
		
		for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		}
		
		int fin = 0;
		for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		}
		
		System.out.println(fin);
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] ary = new int[3];
		
		for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		}
		in.nextLine();
		int k = in.nextInt();
		
		Arrays.sort(ary);
		
		for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		}
		
		int fin = 0;
		for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		}
		
		System.out.println(fin);
	} main {
		Scanner in = new Scanner(System.in);
		int[] ary = new int[3];
		
		for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		}
		in.nextLine();
		int k = in.nextInt();
		
		Arrays.sort(ary);
		
		for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		}
		
		int fin = 0;
		for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		}
		
		System.out.println(fin);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int[] ary = new int[3]; ary new int[3] 3 for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			ary[i] = in.nextInt();
		} {
			ary[i] = in.nextInt();
		} ary[i] = in.nextInt() ary[i] ary i in.nextInt() in.nextInt in in.nextLine() in.nextLine in int k = in.nextInt(); k in.nextInt() in.nextInt in Arrays.sort(ary) Arrays.sort Arrays ary for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		} int i = 1; int i = 1; i 1 i <= k i k i++ i++ i {
			ary[2] = ary[2]*2;
		} {
			ary[2] = ary[2]*2;
		} ary[2] = ary[2]*2 ary[2] ary 2 ary[2]*2 ary[2] ary 2 2 int fin = 0; fin 0 for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			fin += ary[i];
		} {
			fin += ary[i];
		} fin += ary[i] fin ary[i] ary i System.out.println(fin) System.out.println System.out System System.out fin String[] args args public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] ary = new int[3];
		
		for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		}
		in.nextLine();
		int k = in.nextInt();
		
		Arrays.sort(ary);
		
		for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		}
		
		int fin = 0;
		for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		}
		
		System.out.println(fin);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] ary = new int[3];
		
		for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		}
		in.nextLine();
		int k = in.nextInt();
		
		Arrays.sort(ary);
		
		for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		}
		
		int fin = 0;
		for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		}
		
		System.out.println(fin);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] ary = new int[3];
		
		for ( int i = 0; i < 3; i++ ) {
			ary[i] = in.nextInt();
		}
		in.nextLine();
		int k = in.nextInt();
		
		Arrays.sort(ary);
		
		for ( int i = 1; i <= k; i++ ) {
			ary[2] = ary[2]*2;
		}
		
		int fin = 0;
		for ( int i = 0; i < 3; i++ ) {
			fin += ary[i];
		}
		
		System.out.println(fin);
	}
}