import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long[] ans = new long[3]; ans new long[3] 3 ans[0] = sc.nextLong() ans[0] ans 0 sc.nextLong() sc.nextLong sc ans[1] = sc.nextLong() ans[1] ans 1 sc.nextLong() sc.nextLong sc ans[2] = sc.nextLong() ans[2] ans 2 sc.nextLong() sc.nextLong sc int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long max = 0; max 0 for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
            max = Math.max(ans[i], ans[i + 1]);
        } {
            max = Math.max(ans[i], ans[i + 1]);
        } max = Math.max(ans[i], ans[i + 1]) max Math.max(ans[i], ans[i + 1]) Math.max Math ans[i] ans i ans[i + 1] ans i + 1 i 1 int maxIndex = 0; maxIndex 0 for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if (ans[i] == max) {
                maxIndex = i;
            }
        } {
            if (ans[i] == max) {
                maxIndex = i;
            }
        } if (ans[i] == max) {
                maxIndex = i;
            } ans[i] == max ans[i] ans i max {
                maxIndex = i;
            } maxIndex = i maxIndex i while (N > 0) {
            max = max * 2;
            N--;
        } N > 0 N 0 {
            max = max * 2;
            N--;
        } max = max * 2 max max * 2 max 2 N-- N long res = 0; res 0 for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        } {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        } if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            } maxIndex == i maxIndex i {
                res += max;
            } res += max res max {
                res += ans[i];
            } res += ans[i] res ans[i] ans i System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    }
}
