import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int x = scan.nextInt();
		int max = a;
		int sum = 0;
		int num1 = b;
		int num2 = c;

		if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		}

		for (int i=0; i<x; i++) {
			max = max*2;
		}

		sum = num1 + num2 + max;

		System.out.println(sum);

		scan.close();

	}

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

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int x = scan.nextInt();
		int max = a;
		int sum = 0;
		int num1 = b;
		int num2 = c;

		if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		}

		for (int i=0; i<x; i++) {
			max = max*2;
		}

		sum = num1 + num2 + max;

		System.out.println(sum);

		scan.close();

	}

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

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int x = scan.nextInt();
		int max = a;
		int sum = 0;
		int num1 = b;
		int num2 = c;

		if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		}

		for (int i=0; i<x; i++) {
			max = max*2;
		}

		sum = num1 + num2 + max;

		System.out.println(sum);

		scan.close();

	} main {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int x = scan.nextInt();
		int max = a;
		int sum = 0;
		int num1 = b;
		int num2 = c;

		if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		}

		for (int i=0; i<x; i++) {
			max = max*2;
		}

		sum = num1 + num2 + max;

		System.out.println(sum);

		scan.close();

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int max = a; max a int sum = 0; sum 0 int num1 = b; num1 b int num2 = c; num2 c if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		} a < b a b {
			num1 = a;
			num2 = c;
			max = b;
		} num1 = a num1 a num2 = c num2 c max = b max b if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		} a < c a c {
			num1 = a;
			num2 = b;
			max = c;
		} num1 = a num1 a num2 = b num2 b max = c max c for (int i=0; i<x; i++) {
			max = max*2;
		} int i=0; int i=0; i 0 i<x i x i++ i++ i {
			max = max*2;
		} {
			max = max*2;
		} max = max*2 max max*2 max 2 sum = num1 + num2 + max sum num1 + num2 + max num1 + num2 + max num1 num2 max System.out.println(sum) System.out.println System.out System System.out sum scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int x = scan.nextInt();
		int max = a;
		int sum = 0;
		int num1 = b;
		int num2 = c;

		if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		}

		for (int i=0; i<x; i++) {
			max = max*2;
		}

		sum = num1 + num2 + max;

		System.out.println(sum);

		scan.close();

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int x = scan.nextInt();
		int max = a;
		int sum = 0;
		int num1 = b;
		int num2 = c;

		if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		}

		for (int i=0; i<x; i++) {
			max = max*2;
		}

		sum = num1 + num2 + max;

		System.out.println(sum);

		scan.close();

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int x = scan.nextInt();
		int max = a;
		int sum = 0;
		int num1 = b;
		int num2 = c;

		if (a < b) {
			num1 = a;
			num2 = c;
			max = b;
		} else if (a < c) {
			num1 = a;
			num2 = b;
			max = c;
		}

		for (int i=0; i<x; i++) {
			max = max*2;
		}

		sum = num1 + num2 + max;

		System.out.println(sum);

		scan.close();

	}

}
