import java.util.*;

class Main{
	public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
		long a[] = new long[3];
		for(int i = 0; i < 3; i++) a[i] = sc.nextLong();
		int K = sc.nextInt();
		Arrays.sort(a);
		for(int i = 1; i <= K; i++) a[2] *= 2;
		long ans = 0;
		for(int i = 0; i < 3; i++) ans += a[i];
		System.out.println(ans);
	}
} import java.util.*; util.* java class Main{
	public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
		long a[] = new long[3];
		for(int i = 0; i < 3; i++) a[i] = sc.nextLong();
		int K = sc.nextInt();
		Arrays.sort(a);
		for(int i = 1; i <= K; i++) a[2] *= 2;
		long ans = 0;
		for(int i = 0; i < 3; i++) ans += a[i];
		System.out.println(ans);
	}
} Main public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
		long a[] = new long[3];
		for(int i = 0; i < 3; i++) a[i] = sc.nextLong();
		int K = sc.nextInt();
		Arrays.sort(a);
		for(int i = 1; i <= K; i++) a[2] *= 2;
		long ans = 0;
		for(int i = 0; i < 3; i++) ans += a[i];
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		long a[] = new long[3];
		for(int i = 0; i < 3; i++) a[i] = sc.nextLong();
		int K = sc.nextInt();
		Arrays.sort(a);
		for(int i = 1; i <= K; i++) a[2] *= 2;
		long ans = 0;
		for(int i = 0; i < 3; i++) ans += a[i];
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a[] = new long[3]; a new long[3] 3 for(int i = 0; i < 3; i++) a[i] = sc.nextLong(); int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i a[i] = sc.nextLong(); a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc Arrays.sort(a) Arrays.sort Arrays a for(int i = 1; i <= K; i++) a[2] *= 2; int i = 1; int i = 1; i 1 i <= K i K i++ i++ i a[2] *= 2; a[2] *= 2 a[2] a 2 2 long ans = 0; ans 0 for(int i = 0; i < 3; i++) ans += a[i]; int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i ans += a[i]; ans += a[i] ans a[i] a i System.out.println(ans) System.out.println System.out System System.out ans String args[] args
import java.util.*;

class Main{
	public static void main(String args[]) throws Exception{
		Scanner sc = new Scanner(System.in);
		long a[] = new long[3];
		for(int i = 0; i < 3; i++) a[i] = sc.nextLong();
		int K = sc.nextInt();
		Arrays.sort(a);
		for(int i = 1; i <= K; i++) a[2] *= 2;
		long ans = 0;
		for(int i = 0; i < 3; i++) ans += a[i];
		System.out.println(ans);
	}
}