import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		}

		final int k = sc.nextInt();

		for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		}

		int result = 0;
		for (final int item : list) {
			result = result + item;
		}

		System.out.println(result);

	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		}

		final int k = sc.nextInt();

		for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		}

		int result = 0;
		for (final int item : list) {
			result = result + item;
		}

		System.out.println(result);

	}

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

		Scanner sc = new Scanner(System.in);

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		}

		final int k = sc.nextInt();

		for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		}

		int result = 0;
		for (final int item : list) {
			result = result + item;
		}

		System.out.println(result);

	} main {

		Scanner sc = new Scanner(System.in);

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		}

		final int k = sc.nextInt();

		for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		}

		int result = 0;
		for (final int item : list) {
			result = result + item;
		}

		System.out.println(result);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			list.add(sc.nextInt());
		} {
			list.add(sc.nextInt());
		} list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc final int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		} int j = 0; int j = 0; j 0 j < k j k j++ j++ j {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		} {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		} final int max = Collections.max(list); max Collections.max(list) Collections.max Collections list final int maxIndex = list.indexOf(max); maxIndex list.indexOf(max) list.indexOf list max final int mul = max * 2; mul max * 2 max 2 list.set(maxIndex, mul) list.set list maxIndex mul int result = 0; result 0 for (final int item : list) {
			result = result + item;
		} final int item list {
			result = result + item;
		} {
			result = result + item;
		} result = result + item result result + item result item System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		}

		final int k = sc.nextInt();

		for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		}

		int result = 0;
		for (final int item : list) {
			result = result + item;
		}

		System.out.println(result);

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		}

		final int k = sc.nextInt();

		for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		}

		int result = 0;
		for (final int item : list) {
			result = result + item;
		}

		System.out.println(result);

	}

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 3; i++) {
			list.add(sc.nextInt());
		}

		final int k = sc.nextInt();

		for (int j = 0; j < k; j++) {
			final int max = Collections.max(list);
			final int maxIndex = list.indexOf(max);
			final int mul = max * 2;
			list.set(maxIndex, mul);
		}

		int result = 0;
		for (final int item : list) {
			result = result + item;
		}

		System.out.println(result);

	}

}
