import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int target = 0;
		int amari = 0;
		if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		}
		if (target < c) {
			amari = a + b;
			target = c;
		}
		for(int i = 0; i < x; i++) {
			target *= 2;
		}
		System.out.println(target + amari);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int target = 0;
		int amari = 0;
		if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		}
		if (target < c) {
			amari = a + b;
			target = c;
		}
		for(int i = 0; i < x; i++) {
			target *= 2;
		}
		System.out.println(target + amari);
	}
} Main public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int target = 0;
		int amari = 0;
		if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		}
		if (target < c) {
			amari = a + b;
			target = c;
		}
		for(int i = 0; i < x; i++) {
			target *= 2;
		}
		System.out.println(target + amari);
	} main {
		Scanner sc  = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int target = 0;
		int amari = 0;
		if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		}
		if (target < c) {
			amari = a + b;
			target = c;
		}
		for(int i = 0; i < x; i++) {
			target *= 2;
		}
		System.out.println(target + amari);
	} Scanner sc  = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int target = 0; target 0 int amari = 0; amari 0 if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		} a > b a b {
			amari = b + c;
			target = a;
		} amari = b + c amari b + c b c target = a target a {
			amari = a + c;
			target = b;
		} amari = a + c amari a + c a c target = b target b if (target < c) {
			amari = a + b;
			target = c;
		} target < c target c {
			amari = a + b;
			target = c;
		} amari = a + b amari a + b a b target = c target c for(int i = 0; i < x; i++) {
			target *= 2;
		} int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
			target *= 2;
		} {
			target *= 2;
		} target *= 2 target 2 System.out.println(target + amari) System.out.println System.out System System.out target + amari target amari String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int target = 0;
		int amari = 0;
		if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		}
		if (target < c) {
			amari = a + b;
			target = c;
		}
		for(int i = 0; i < x; i++) {
			target *= 2;
		}
		System.out.println(target + amari);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int target = 0;
		int amari = 0;
		if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		}
		if (target < c) {
			amari = a + b;
			target = c;
		}
		for(int i = 0; i < x; i++) {
			target *= 2;
		}
		System.out.println(target + amari);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		int target = 0;
		int amari = 0;
		if(a > b) {
			amari = b + c;
			target = a;
		} else {
			amari = a + c;
			target = b;
		}
		if (target < c) {
			amari = a + b;
			target = c;
		}
		for(int i = 0; i < x; i++) {
			target *= 2;
		}
		System.out.println(target + amari);
	}
}