
import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int[] list = new int[3];
		for (int i = 0; i < 3; i++) {
			list[i] = scan.nextInt();
		}
		int k = scan.nextInt();
		Arrays.sort(list);
		
		int ans = (int) (Math.pow(2, k) * list[2]) + list[0] + list[1];
		System.out.println(ans);
		
	}
} import java.sql.Array; Array java.sql import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int[] list = new int[3];
		for (int i = 0; i < 3; i++) {
			list[i] = scan.nextInt();
		}
		int k = scan.nextInt();
		Arrays.sort(list);
		
		int ans = (int) (Math.pow(2, k) * list[2]) + list[0] + list[1];
		System.out.println(ans);
		
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int[] list = new int[3];
		for (int i = 0; i < 3; i++) {
			list[i] = scan.nextInt();
		}
		int k = scan.nextInt();
		Arrays.sort(list);
		
		int ans = (int) (Math.pow(2, k) * list[2]) + list[0] + list[1];
		System.out.println(ans);
		
	} main {

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

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

		Scanner scan = new Scanner(System.in);
		int[] list = new int[3];
		for (int i = 0; i < 3; i++) {
			list[i] = scan.nextInt();
		}
		int k = scan.nextInt();
		Arrays.sort(list);
		
		int ans = (int) (Math.pow(2, k) * list[2]) + list[0] + list[1];
		System.out.println(ans);
		
	}
} Main

import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int[] list = new int[3];
		for (int i = 0; i < 3; i++) {
			list[i] = scan.nextInt();
		}
		int k = scan.nextInt();
		Arrays.sort(list);
		
		int ans = (int) (Math.pow(2, k) * list[2]) + list[0] + list[1];
		System.out.println(ans);
		
	}
}