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();

        if (a <= b) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

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

        if (a <= b) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

        }
    }
} 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) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

        }
    } 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) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

        }
    } 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) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

        } a <= b a b {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            } b <= c b c {
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } System.out.println((int)(Math.pow(2,k)*c+a+b)) System.out.println System.out System System.out (int)(Math.pow(2,k)*c+a+b) Math.pow(2,k)*c+a+b Math.pow(2,k)*c Math.pow(2,k) Math.pow Math 2 k c a b {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            } System.out.println((int)(Math.pow(2,k)*b+a+c)) System.out.println System.out System System.out (int)(Math.pow(2,k)*b+a+c) Math.pow(2,k)*b+a+c Math.pow(2,k)*b Math.pow(2,k) Math.pow Math 2 k b a c {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

        } if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            } a <= c a c {
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } System.out.println((int)(Math.pow(2,k)*c+a+b)) System.out.println System.out System System.out (int)(Math.pow(2,k)*c+a+b) Math.pow(2,k)*c+a+b Math.pow(2,k)*c Math.pow(2,k) Math.pow Math 2 k c a b {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            } System.out.println((int)(Math.pow(2,k)*a+b+c)) System.out.println System.out System System.out (int)(Math.pow(2,k)*a+b+c) Math.pow(2,k)*a+b+c Math.pow(2,k)*a Math.pow(2,k) Math.pow Math 2 k a b c 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();

        if (a <= b) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

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

        if (a <= b) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

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

        if (a <= b) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

        }
    }
}