
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int k=scanner.nextInt();
        int max=Math.max(Math.max(a,b),c);
        System.out.println((int)(a+b+c+max*Math.pow(2,k)-max));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int k=scanner.nextInt();
        int max=Math.max(Math.max(a,b),c);
        System.out.println((int)(a+b+c+max*Math.pow(2,k)-max));
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int k=scanner.nextInt();
        int max=Math.max(Math.max(a,b),c);
        System.out.println((int)(a+b+c+max*Math.pow(2,k)-max));
    } main {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int k=scanner.nextInt();
        int max=Math.max(Math.max(a,b),c);
        System.out.println((int)(a+b+c+max*Math.pow(2,k)-max));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a=scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b=scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int c=scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner int k=scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner int max=Math.max(Math.max(a,b),c); max Math.max(Math.max(a,b),c) Math.max Math Math.max(a,b) Math.max Math a b c System.out.println((int)(a+b+c+max*Math.pow(2,k)-max)) System.out.println System.out System System.out (int)(a+b+c+max*Math.pow(2,k)-max) a+b+c+max*Math.pow(2,k) c a+b+c+max*Math.pow(2,k) a b c max*Math.pow(2,k) max Math.pow(2,k) Math.pow Math 2 k max String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int k=scanner.nextInt();
        int max=Math.max(Math.max(a,b),c);
        System.out.println((int)(a+b+c+max*Math.pow(2,k)-max));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int k=scanner.nextInt();
        int max=Math.max(Math.max(a,b),c);
        System.out.println((int)(a+b+c+max*Math.pow(2,k)-max));
    }
} Main

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=scanner.nextInt();
        int k=scanner.nextInt();
        int max=Math.max(Math.max(a,b),c);
        System.out.println((int)(a+b+c+max*Math.pow(2,k)-max));
    }
}
