//B.java
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] num = new int[3];
        int max = 0;
        for(int i=0; i<3; i++) {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        }
        int k = sc.nextInt();

        sc.close();
        double ans = Math.pow(2, k)*max + num[0] + num[1] + num[2] - max;
        System.out.println((int)ans);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] num = new int[3];
        int max = 0;
        for(int i=0; i<3; i++) {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        }
        int k = sc.nextInt();

        sc.close();
        double ans = Math.pow(2, k)*max + num[0] + num[1] + num[2] - max;
        System.out.println((int)ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] num = new int[3];
        int max = 0;
        for(int i=0; i<3; i++) {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        }
        int k = sc.nextInt();

        sc.close();
        double ans = Math.pow(2, k)*max + num[0] + num[1] + num[2] - max;
        System.out.println((int)ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] num = new int[3];
        int max = 0;
        for(int i=0; i<3; i++) {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        }
        int k = sc.nextInt();

        sc.close();
        double ans = Math.pow(2, k)*max + num[0] + num[1] + num[2] - max;
        System.out.println((int)ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] num = new int[3]; num new int[3] 3 int max = 0; max 0 for(int i=0; i<3; i++) {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        } {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        } num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc if(max < num[i]) max = num[i]; max < num[i] max num[i] num i max = num[i] max num[i] num i int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc sc.close() sc.close sc double ans = Math.pow(2, k)*max + num[0] + num[1] + num[2] - max; ans Math.pow(2, k)*max + num[0] + num[1] + num[2] - max Math.pow(2, k)*max + num[0] + num[1] + num[2] num[1] Math.pow(2, k)*max + num[0] + num[1] + num[2] Math.pow(2, k)*max Math.pow(2, k) Math.pow Math 2 k max num[0] num 0 num[1] num 1 num[2] num 2 max System.out.println((int)ans) System.out.println System.out System System.out (int)ans String[] args args
//B.java
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] num = new int[3];
        int max = 0;
        for(int i=0; i<3; i++) {
            num[i] = sc.nextInt();
            if(max < num[i]) max = num[i];
        }
        int k = sc.nextInt();

        sc.close();
        double ans = Math.pow(2, k)*max + num[0] + num[1] + num[2] - max;
        System.out.println((int)ans);
    }
}