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();
        sc.close();

        int max = 0;
        int ans = 0;

        max = Math.max(Math.max(a, b), c);
        if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        }

        ans += max * Math.pow(2, k);

        System.out.println(ans);
    }
} 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();
        sc.close();

        int max = 0;
        int ans = 0;

        max = Math.max(Math.max(a, b), c);
        if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        }

        ans += max * Math.pow(2, k);

        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();
        sc.close();

        int max = 0;
        int ans = 0;

        max = Math.max(Math.max(a, b), c);
        if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        }

        ans += max * Math.pow(2, k);

        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();
        sc.close();

        int max = 0;
        int ans = 0;

        max = Math.max(Math.max(a, b), c);
        if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        }

        ans += max * Math.pow(2, k);

        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 sc.close() sc.close sc int max = 0; max 0 int ans = 0; ans 0 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 if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        } max == a max a {
            ans = b + c;
        } ans = b + c ans b + c b c if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        } max == b max b {
            ans = a + c;
        } ans = a + c ans a + c a c {
            ans = a + b;
        } ans = a + b ans a + b a b ans += max * Math.pow(2, k) ans max * Math.pow(2, k) max Math.pow(2, k) Math.pow Math 2 k 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();
        sc.close();

        int max = 0;
        int ans = 0;

        max = Math.max(Math.max(a, b), c);
        if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        }

        ans += max * Math.pow(2, k);

        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();
        sc.close();

        int max = 0;
        int ans = 0;

        max = Math.max(Math.max(a, b), c);
        if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        }

        ans += max * Math.pow(2, k);

        System.out.println(ans);
    }
} 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();
        sc.close();

        int max = 0;
        int ans = 0;

        max = Math.max(Math.max(a, b), c);
        if (max == a) {
            ans = b + c;
        } else if (max == b) {
            ans = a + c;
        } else {
            ans = a + b;
        }

        ans += max * Math.pow(2, k);

        System.out.println(ans);
    }
}