import java.util.Scanner;

public class Main {
    static public void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        scan.close();

        int max = Math.max(Math.max(a, b), c);

        int remains = 0;
        if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        }

        int maxResult = max;
        for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        }

        System.out.println(maxResult + remains);

    }
} import java.util.Scanner; Scanner java.util public class Main {
    static public void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        scan.close();

        int max = Math.max(Math.max(a, b), c);

        int remains = 0;
        if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        }

        int maxResult = max;
        for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        }

        System.out.println(maxResult + remains);

    }
} Main static public void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        scan.close();

        int max = Math.max(Math.max(a, b), c);

        int remains = 0;
        if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        }

        int maxResult = max;
        for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        }

        System.out.println(maxResult + remains);

    } main {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        scan.close();

        int max = Math.max(Math.max(a, b), c);

        int remains = 0;
        if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        }

        int maxResult = max;
        for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        }

        System.out.println(maxResult + remains);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan scan.close() scan.close scan 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 remains = 0; remains 0 if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        } max == a max a {
            remains = b + c;
        } remains = b + c remains b + c b c if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        } max == b max b {
            remains = a + c;
        } remains = a + c remains a + c a c {
            remains = a + b;
        } remains = a + b remains a + b a b int maxResult = max; maxResult max for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            maxResult = maxResult * 2;
        } {
            maxResult = maxResult * 2;
        } maxResult = maxResult * 2 maxResult maxResult * 2 maxResult 2 System.out.println(maxResult + remains) System.out.println System.out System System.out maxResult + remains maxResult remains String[] args args public class Main {
    static public void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        scan.close();

        int max = Math.max(Math.max(a, b), c);

        int remains = 0;
        if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        }

        int maxResult = max;
        for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        }

        System.out.println(maxResult + remains);

    }
} public class Main {
    static public void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        scan.close();

        int max = Math.max(Math.max(a, b), c);

        int remains = 0;
        if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        }

        int maxResult = max;
        for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        }

        System.out.println(maxResult + remains);

    }
} Main
import java.util.Scanner;

public class Main {
    static public void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        scan.close();

        int max = Math.max(Math.max(a, b), c);

        int remains = 0;
        if (max == a) {
            remains = b + c;
        } else if (max == b) {
            remains = a + c;
        } else {
            remains = a + b;
        }

        int maxResult = max;
        for (int i = 0; i < k; i++) {
            maxResult = maxResult * 2;
        }

        System.out.println(maxResult + remains);

    }
}
