import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s1 = sc.nextLine().split(" ");
        int k = Integer.parseInt(sc.nextLine());

        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);


        int result=0;


        int max = Math.max(a, Math.max(b, c));
        double tmp = Math.pow((double)2, (double)k);
        result = max *(int)tmp  + a + b + c -max;

        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s1 = sc.nextLine().split(" ");
        int k = Integer.parseInt(sc.nextLine());

        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);


        int result=0;


        int max = Math.max(a, Math.max(b, c));
        double tmp = Math.pow((double)2, (double)k);
        result = max *(int)tmp  + a + b + c -max;

        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s1 = sc.nextLine().split(" ");
        int k = Integer.parseInt(sc.nextLine());

        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);


        int result=0;


        int max = Math.max(a, Math.max(b, c));
        double tmp = Math.pow((double)2, (double)k);
        result = max *(int)tmp  + a + b + c -max;

        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        String[] s1 = sc.nextLine().split(" ");
        int k = Integer.parseInt(sc.nextLine());

        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);


        int result=0;


        int max = Math.max(a, Math.max(b, c));
        double tmp = Math.pow((double)2, (double)k);
        result = max *(int)tmp  + a + b + c -max;

        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] s1 = sc.nextLine().split(" "); s1 sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int k = Integer.parseInt(sc.nextLine()); k Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc int a = Integer.parseInt(s1[0]); a Integer.parseInt(s1[0]) Integer.parseInt Integer s1[0] s1 0 int b = Integer.parseInt(s1[1]); b Integer.parseInt(s1[1]) Integer.parseInt Integer s1[1] s1 1 int c = Integer.parseInt(s1[2]); c Integer.parseInt(s1[2]) Integer.parseInt Integer s1[2] s1 2 int result=0; result 0 int max = Math.max(a, Math.max(b, c)); max Math.max(a, Math.max(b, c)) Math.max Math a Math.max(b, c) Math.max Math b c double tmp = Math.pow((double)2, (double)k); tmp Math.pow((double)2, (double)k) Math.pow Math (double)2 (double)k result = max *(int)tmp  + a + b + c -max result max *(int)tmp  + a + b + c -max max *(int)tmp  + a + b + c b max *(int)tmp  + a + b + c max *(int)tmp max (int)tmp a b c max 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) {
        Scanner sc = new Scanner(System.in);
        String[] s1 = sc.nextLine().split(" ");
        int k = Integer.parseInt(sc.nextLine());

        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);


        int result=0;


        int max = Math.max(a, Math.max(b, c));
        double tmp = Math.pow((double)2, (double)k);
        result = max *(int)tmp  + a + b + c -max;

        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s1 = sc.nextLine().split(" ");
        int k = Integer.parseInt(sc.nextLine());

        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);


        int result=0;


        int max = Math.max(a, Math.max(b, c));
        double tmp = Math.pow((double)2, (double)k);
        result = max *(int)tmp  + a + b + c -max;

        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s1 = sc.nextLine().split(" ");
        int k = Integer.parseInt(sc.nextLine());

        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        int c = Integer.parseInt(s1[2]);


        int result=0;


        int max = Math.max(a, Math.max(b, c));
        double tmp = Math.pow((double)2, (double)k);
        result = max *(int)tmp  + a + b + c -max;

        System.out.println(result);
    }
}