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