import java.util.*;
public class Main {

		static void solve(){
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Integer.MIN_VALUE;
			max = Math.max(a, b);
			max = Math.max(max, c);
			int max1 = max*2;
			sc.close();
			for(int i = 0;i<k;i++) {
				max*=2;
			}
			System.out.println(a+b+c+max-max1/2);
		}
	public static void main(String[] args) {
		solve();

	}

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

		static void solve(){
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Integer.MIN_VALUE;
			max = Math.max(a, b);
			max = Math.max(max, c);
			int max1 = max*2;
			sc.close();
			for(int i = 0;i<k;i++) {
				max*=2;
			}
			System.out.println(a+b+c+max-max1/2);
		}
	public static void main(String[] args) {
		solve();

	}

} Main static void solve(){
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Integer.MIN_VALUE;
			max = Math.max(a, b);
			max = Math.max(max, c);
			int max1 = max*2;
			sc.close();
			for(int i = 0;i<k;i++) {
				max*=2;
			}
			System.out.println(a+b+c+max-max1/2);
		} solve {
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Integer.MIN_VALUE;
			max = Math.max(a, b);
			max = Math.max(max, c);
			int max1 = max*2;
			sc.close();
			for(int i = 0;i<k;i++) {
				max*=2;
			}
			System.out.println(a+b+c+max-max1/2);
		} 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 k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE max = Math.max(a, b) max Math.max(a, b) Math.max Math a b max = Math.max(max, c) max Math.max(max, c) Math.max Math max c int max1 = max*2; max1 max*2 max 2 sc.close() sc.close sc for(int i = 0;i<k;i++) {
				max*=2;
			} int i = 0; int i = 0; i 0 i<k i k i++ i++ i {
				max*=2;
			} {
				max*=2;
			} max*=2 max 2 System.out.println(a+b+c+max-max1/2) System.out.println System.out System System.out a+b+c+max-max1/2 a+b+c+max c a+b+c+max a b c max max1/2 max1 2 public static void main(String[] args) {
		solve();

	} main {
		solve();

	} solve() solve String[] args args public class Main {

		static void solve(){
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Integer.MIN_VALUE;
			max = Math.max(a, b);
			max = Math.max(max, c);
			int max1 = max*2;
			sc.close();
			for(int i = 0;i<k;i++) {
				max*=2;
			}
			System.out.println(a+b+c+max-max1/2);
		}
	public static void main(String[] args) {
		solve();

	}

} public class Main {

		static void solve(){
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Integer.MIN_VALUE;
			max = Math.max(a, b);
			max = Math.max(max, c);
			int max1 = max*2;
			sc.close();
			for(int i = 0;i<k;i++) {
				max*=2;
			}
			System.out.println(a+b+c+max-max1/2);
		}
	public static void main(String[] args) {
		solve();

	}

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

		static void solve(){
			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();
			int max = Integer.MIN_VALUE;
			max = Math.max(a, b);
			max = Math.max(max, c);
			int max1 = max*2;
			sc.close();
			for(int i = 0;i<k;i++) {
				max*=2;
			}
			System.out.println(a+b+c+max-max1/2);
		}
	public static void main(String[] args) {
		solve();

	}

}
