import java.util.Scanner;
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();
        if (A >= B && A >= C) {
            System.out.println((int)(A * Math.pow(2, K) + B + C));
        }
        else if (B >= A && B >= C) {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        }
        else {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        }
    }
} import java.util.Scanner; Scanner java.util 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();
        if (A >= B && A >= C) {
            System.out.println((int)(A * Math.pow(2, K) + B + C));
        }
        else if (B >= A && B >= C) {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        }
        else {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        }
    }
} 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();
        if (A >= B && A >= C) {
            System.out.println((int)(A * Math.pow(2, K) + B + C));
        }
        else if (B >= A && B >= C) {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        }
        else {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        if (A >= B && A >= C) {
            System.out.println((int)(A * Math.pow(2, K) + B + C));
        }
        else if (B >= A && B >= C) {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        }
        else {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        }
    } 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 if (A >= B && A >= C) {
            System.out.println((int)(A * Math.pow(2, K) + B + C));
        }
        else if (B >= A && B >= C) {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        }
        else {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        } A >= B && A >= C A >= B A B A >= C A C {
            System.out.println((int)(A * Math.pow(2, K) + B + C));
        } System.out.println((int)(A * Math.pow(2, K) + B + C)) System.out.println System.out System System.out (int)(A * Math.pow(2, K) + B + C) A * Math.pow(2, K) + B + C A * Math.pow(2, K) A Math.pow(2, K) Math.pow Math 2 K B C if (B >= A && B >= C) {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        }
        else {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        } B >= A && B >= C B >= A B A B >= C B C {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        } System.out.println((int)(B * Math.pow(2, K) + A + C)) System.out.println System.out System System.out (int)(B * Math.pow(2, K) + A + C) B * Math.pow(2, K) + A + C B * Math.pow(2, K) B Math.pow(2, K) Math.pow Math 2 K A C {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        } System.out.println((int)(C * Math.pow(2, K) + A + B)) System.out.println System.out System System.out (int)(C * Math.pow(2, K) + A + B) C * Math.pow(2, K) + A + B C * Math.pow(2, K) C Math.pow(2, K) Math.pow Math 2 K A B String[] args args
import java.util.Scanner;
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();
        if (A >= B && A >= C) {
            System.out.println((int)(A * Math.pow(2, K) + B + C));
        }
        else if (B >= A && B >= C) {
            System.out.println((int)(B * Math.pow(2, K) + A + C));
        }
        else {
            System.out.println((int)(C * Math.pow(2, K) + A + B));
        }
    }
}