import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        long[] n = new long[3];
        n[0] = scanner.nextInt();
        n[1] = scanner.nextInt();
        n[2] = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.close();

        int maxIdx = 0;
        if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        }
        if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        }

        // System.out.println(maxIdx);

        long d = (long) Math.pow(2, k);

        long result = 0;

        for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        }

        System.out.println(result);

        // System.out.println(System.currentTimeMillis() - startTime);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        long[] n = new long[3];
        n[0] = scanner.nextInt();
        n[1] = scanner.nextInt();
        n[2] = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.close();

        int maxIdx = 0;
        if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        }
        if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        }

        // System.out.println(maxIdx);

        long d = (long) Math.pow(2, k);

        long result = 0;

        for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        }

        System.out.println(result);

        // System.out.println(System.currentTimeMillis() - startTime);
    }
} Main public static void main(String[] args) {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        long[] n = new long[3];
        n[0] = scanner.nextInt();
        n[1] = scanner.nextInt();
        n[2] = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.close();

        int maxIdx = 0;
        if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        }
        if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        }

        // System.out.println(maxIdx);

        long d = (long) Math.pow(2, k);

        long result = 0;

        for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        }

        System.out.println(result);

        // System.out.println(System.currentTimeMillis() - startTime);
    } main {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        long[] n = new long[3];
        n[0] = scanner.nextInt();
        n[1] = scanner.nextInt();
        n[2] = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.close();

        int maxIdx = 0;
        if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        }
        if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        }

        // System.out.println(maxIdx);

        long d = (long) Math.pow(2, k);

        long result = 0;

        for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        }

        System.out.println(result);

        // System.out.println(System.currentTimeMillis() - startTime);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long[] n = new long[3]; n new long[3] 3 n[0] = scanner.nextInt() n[0] n 0 scanner.nextInt() scanner.nextInt scanner n[1] = scanner.nextInt() n[1] n 1 scanner.nextInt() scanner.nextInt scanner n[2] = scanner.nextInt() n[2] n 2 scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner scanner.close() scanner.close scanner int maxIdx = 0; maxIdx 0 if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        } n[maxIdx] < n[1] n[maxIdx] n maxIdx n[1] n 1 {
            maxIdx = 1;
        } maxIdx = 1 maxIdx 1 if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        } n[maxIdx] < n[2] n[maxIdx] n maxIdx n[2] n 2 {
            maxIdx = 2;
        } maxIdx = 2 maxIdx 2 long d = (long) Math.pow(2, k); d (long) Math.pow(2, k) Math.pow Math 2 k long result = 0; result 0 for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        } {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        } result += (i == maxIdx) ? (n[i] * d) : n[i] result (i == maxIdx) ? (n[i] * d) : n[i] (i == maxIdx) i maxIdx (n[i] * d) n[i] n i d n[i] n i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

    public static void main(String[] args) {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        long[] n = new long[3];
        n[0] = scanner.nextInt();
        n[1] = scanner.nextInt();
        n[2] = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.close();

        int maxIdx = 0;
        if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        }
        if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        }

        // System.out.println(maxIdx);

        long d = (long) Math.pow(2, k);

        long result = 0;

        for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        }

        System.out.println(result);

        // System.out.println(System.currentTimeMillis() - startTime);
    }
} public class Main {

    public static void main(String[] args) {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        long[] n = new long[3];
        n[0] = scanner.nextInt();
        n[1] = scanner.nextInt();
        n[2] = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.close();

        int maxIdx = 0;
        if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        }
        if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        }

        // System.out.println(maxIdx);

        long d = (long) Math.pow(2, k);

        long result = 0;

        for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        }

        System.out.println(result);

        // System.out.println(System.currentTimeMillis() - startTime);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        long[] n = new long[3];
        n[0] = scanner.nextInt();
        n[1] = scanner.nextInt();
        n[2] = scanner.nextInt();
        int k = scanner.nextInt();
        scanner.close();

        int maxIdx = 0;
        if (n[maxIdx] < n[1]) {
            maxIdx = 1;
        }
        if (n[maxIdx] < n[2]) {
            maxIdx = 2;
        }

        // System.out.println(maxIdx);

        long d = (long) Math.pow(2, k);

        long result = 0;

        for (int i = 0; i < 3; i++) {
            result += (i == maxIdx) ? (n[i] * d) : n[i];
        }

        System.out.println(result);

        // System.out.println(System.currentTimeMillis() - startTime);
    }
}