import java.util.Arrays;
import java.util.Scanner;

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

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