import 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();

        int max = Math.max(Math.max(A, B), C);
        int ans = 0;

        if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java 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();

        int max = Math.max(Math.max(A, B), C);
        int ans = 0;

        if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        }
        System.out.println(ans);
    }
} 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();

        int max = Math.max(Math.max(A, B), C);
        int ans = 0;

        if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();

        int max = Math.max(Math.max(A, B), C);
        int ans = 0;

        if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        }
        System.out.println(ans);
    } 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 = Math.max(Math.max(A, B), C); max Math.max(Math.max(A, B), C) Math.max Math Math.max(A, B) Math.max Math A B C int ans = 0; ans 0 if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        } max == A max A {
            ans = (int)Math.pow(2, K) * A + B + C;
        } ans = (int)Math.pow(2, K) * A + B + C ans (int)Math.pow(2, K) * A + B + C (int)Math.pow(2, K) * A + B + C (int)Math.pow(2, K) * A (int)Math.pow(2, K) Math.pow Math 2 K A B C if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        } max == B max B {
            ans = (int)Math.pow(2, K) * B + A + C;
        } ans = (int)Math.pow(2, K) * B + A + C ans (int)Math.pow(2, K) * B + A + C (int)Math.pow(2, K) * B + A + C (int)Math.pow(2, K) * B (int)Math.pow(2, K) Math.pow Math 2 K B A C {
            ans = (int)Math.pow(2, K) * C + A + B;
        } ans = (int)Math.pow(2, K) * C + A + B ans (int)Math.pow(2, K) * C + A + B (int)Math.pow(2, K) * C + A + B (int)Math.pow(2, K) * C (int)Math.pow(2, K) Math.pow Math 2 K C A B System.out.println(ans) System.out.println System.out System System.out ans 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 K = sc.nextInt();

        int max = Math.max(Math.max(A, B), C);
        int ans = 0;

        if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        }
        System.out.println(ans);
    }
} 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();

        int max = Math.max(Math.max(A, B), C);
        int ans = 0;

        if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        }
        System.out.println(ans);
    }
} Main
import 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();

        int max = Math.max(Math.max(A, B), C);
        int ans = 0;

        if (max == A) {
            ans = (int)Math.pow(2, K) * A + B + C;
        } else if(max == B) {
            ans = (int)Math.pow(2, K) * B + A + C;
        } else {
            ans = (int)Math.pow(2, K) * C + A + B;
        }
        System.out.println(ans);
    }
}