import java.util.*;
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt(), t = 0;
		Arrays.sort(a);
		while (k-->0) a[a.length-1]*=2;
		for (int b : a) t+=b;
		System.out.println(t);
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

} import java.util.*; util.* java public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt(), t = 0;
		Arrays.sort(a);
		while (k-->0) a[a.length-1]*=2;
		for (int b : a) t+=b;
		System.out.println(t);
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

} Main static void solve() {
		Scanner sc = new Scanner(System.in);
		int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt(), t = 0;
		Arrays.sort(a);
		while (k-->0) a[a.length-1]*=2;
		for (int b : a) t+=b;
		System.out.println(t);
		sc.close();			
	} solve {
		Scanner sc = new Scanner(System.in);
		int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt(), t = 0;
		Arrays.sort(a);
		while (k-->0) a[a.length-1]*=2;
		for (int b : a) t+=b;
		System.out.println(t);
		sc.close();			
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()}; a {sc.nextInt(),sc.nextInt(),sc.nextInt()} sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc int k = sc.nextInt() k sc.nextInt() sc.nextInt sc t = 0; t 0 Arrays.sort(a) Arrays.sort Arrays a while (k-->0) a[a.length-1]*=2; k-->0 k-- k 0 a[a.length-1]*=2 a[a.length-1] a a.length-1 a.length a a.length 1 2 for (int b : a) t+=b; int b a t+=b; t+=b t b System.out.println(t) System.out.println System.out System System.out t sc.close() sc.close sc public static void main(String args[]) {
		solve();
	} main {
		solve();
	} solve() solve String args[] args public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt(), t = 0;
		Arrays.sort(a);
		while (k-->0) a[a.length-1]*=2;
		for (int b : a) t+=b;
		System.out.println(t);
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

} public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt(), t = 0;
		Arrays.sort(a);
		while (k-->0) a[a.length-1]*=2;
		for (int b : a) t+=b;
		System.out.println(t);
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

} Main
import java.util.*;
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int[] a = {sc.nextInt(),sc.nextInt(),sc.nextInt()};
		int k = sc.nextInt(), t = 0;
		Arrays.sort(a);
		while (k-->0) a[a.length-1]*=2;
		for (int b : a) t+=b;
		System.out.println(t);
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

}