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 K = sc.nextInt();


        System.out.println(calc(A, B, C, K));
    }

    public static int calc(int A, int B, int C, int K) {

		int mid = Integer.max(A, B);
//		System.out.println("mid:" + mid);
		int low = Integer.min(A, B);
//		System.out.println("low:" + low);
		int max = Integer.max(mid, C);
		mid = Integer.min(mid, C);
//		System.out.println("max:" + max);

		int total = max;

		for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		}

		total = total + mid + low;
//		System.out.println("total:" + total);
		return total;
	}
} 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 K = sc.nextInt();


        System.out.println(calc(A, B, C, K));
    }

    public static int calc(int A, int B, int C, int K) {

		int mid = Integer.max(A, B);
//		System.out.println("mid:" + mid);
		int low = Integer.min(A, B);
//		System.out.println("low:" + low);
		int max = Integer.max(mid, C);
		mid = Integer.min(mid, C);
//		System.out.println("max:" + max);

		int total = max;

		for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		}

		total = total + mid + low;
//		System.out.println("total:" + total);
		return total;
	}
} 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 K = sc.nextInt();


        System.out.println(calc(A, B, C, K));
    } main {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();


        System.out.println(calc(A, B, C, K));
    } 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 System.out.println(calc(A, B, C, K)) System.out.println System.out System System.out calc(A, B, C, K) calc A B C K String[] args args public static int calc(int A, int B, int C, int K) {

		int mid = Integer.max(A, B);
//		System.out.println("mid:" + mid);
		int low = Integer.min(A, B);
//		System.out.println("low:" + low);
		int max = Integer.max(mid, C);
		mid = Integer.min(mid, C);
//		System.out.println("max:" + max);

		int total = max;

		for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		}

		total = total + mid + low;
//		System.out.println("total:" + total);
		return total;
	} calc {

		int mid = Integer.max(A, B);
//		System.out.println("mid:" + mid);
		int low = Integer.min(A, B);
//		System.out.println("low:" + low);
		int max = Integer.max(mid, C);
		mid = Integer.min(mid, C);
//		System.out.println("max:" + max);

		int total = max;

		for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		}

		total = total + mid + low;
//		System.out.println("total:" + total);
		return total;
	} int mid = Integer.max(A, B); mid Integer.max(A, B) Integer.max Integer A B int low = Integer.min(A, B); low Integer.min(A, B) Integer.min Integer A B int max = Integer.max(mid, C); max Integer.max(mid, C) Integer.max Integer mid C mid = Integer.min(mid, C) mid Integer.min(mid, C) Integer.min Integer mid C int total = max; total max for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		} int i = 1; int i = 1; i 1 i <= K i K i++ i++ i {
			total = total * 2;
//			System.out.println("total:" + total);
		} {
			total = total * 2;
//			System.out.println("total:" + total);
		} total = total * 2 total total * 2 total 2 total = total + mid + low total total + mid + low total + mid + low total mid low return total; total int A A int B B int C C int K K 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 K = sc.nextInt();


        System.out.println(calc(A, B, C, K));
    }

    public static int calc(int A, int B, int C, int K) {

		int mid = Integer.max(A, B);
//		System.out.println("mid:" + mid);
		int low = Integer.min(A, B);
//		System.out.println("low:" + low);
		int max = Integer.max(mid, C);
		mid = Integer.min(mid, C);
//		System.out.println("max:" + max);

		int total = max;

		for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		}

		total = total + mid + low;
//		System.out.println("total:" + total);
		return total;
	}
} 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 K = sc.nextInt();


        System.out.println(calc(A, B, C, K));
    }

    public static int calc(int A, int B, int C, int K) {

		int mid = Integer.max(A, B);
//		System.out.println("mid:" + mid);
		int low = Integer.min(A, B);
//		System.out.println("low:" + low);
		int max = Integer.max(mid, C);
		mid = Integer.min(mid, C);
//		System.out.println("max:" + max);

		int total = max;

		for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		}

		total = total + mid + low;
//		System.out.println("total:" + total);
		return total;
	}
} 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 K = sc.nextInt();


        System.out.println(calc(A, B, C, K));
    }

    public static int calc(int A, int B, int C, int K) {

		int mid = Integer.max(A, B);
//		System.out.println("mid:" + mid);
		int low = Integer.min(A, B);
//		System.out.println("low:" + low);
		int max = Integer.max(mid, C);
		mid = Integer.min(mid, C);
//		System.out.println("max:" + max);

		int total = max;

		for (int i = 1; i <= K; i++) {
			total = total * 2;
//			System.out.println("total:" + total);
		}

		total = total + mid + low;
//		System.out.println("total:" + total);
		return total;
	}
}