import java.util.*;
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int abc[] = new int[3];
        for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        }

        int bai = sc.nextInt();
        int last=1;
        for(int i=1;i<=bai;i++) {
            last = last * 2;
        }
        int max=0;

        for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        }
        int lastmax=max*last;
        int ans=abc[0]+abc[1]+abc[2]-max+lastmax;
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int abc[] = new int[3];
        for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        }

        int bai = sc.nextInt();
        int last=1;
        for(int i=1;i<=bai;i++) {
            last = last * 2;
        }
        int max=0;

        for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        }
        int lastmax=max*last;
        int ans=abc[0]+abc[1]+abc[2]-max+lastmax;
        System.out.println(ans);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int abc[] = new int[3];
        for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        }

        int bai = sc.nextInt();
        int last=1;
        for(int i=1;i<=bai;i++) {
            last = last * 2;
        }
        int max=0;

        for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        }
        int lastmax=max*last;
        int ans=abc[0]+abc[1]+abc[2]-max+lastmax;
        System.out.println(ans);
    } main {

        Scanner sc = new Scanner(System.in);
        int abc[] = new int[3];
        for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        }

        int bai = sc.nextInt();
        int last=1;
        for(int i=1;i<=bai;i++) {
            last = last * 2;
        }
        int max=0;

        for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        }
        int lastmax=max*last;
        int ans=abc[0]+abc[1]+abc[2]-max+lastmax;
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int abc[] = new int[3]; abc new int[3] 3 for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            abc[i]=sc.nextInt();
        } {
            abc[i]=sc.nextInt();
        } abc[i]=sc.nextInt() abc[i] abc i sc.nextInt() sc.nextInt sc int bai = sc.nextInt(); bai sc.nextInt() sc.nextInt sc int last=1; last 1 for(int i=1;i<=bai;i++) {
            last = last * 2;
        } int i=1; int i=1; i 1 i<=bai i bai i++ i++ i {
            last = last * 2;
        } {
            last = last * 2;
        } last = last * 2 last last * 2 last 2 int max=0; max 0 for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            max=Math.max(max,abc[i]);
        } {
            max=Math.max(max,abc[i]);
        } max=Math.max(max,abc[i]) max Math.max(max,abc[i]) Math.max Math max abc[i] abc i int lastmax=max*last; lastmax max*last max last int ans=abc[0]+abc[1]+abc[2]-max+lastmax; ans abc[0]+abc[1]+abc[2]-max+lastmax abc[0]+abc[1]+abc[2]-max abc[0]+abc[1]+abc[2] abc[0]+abc[1]+abc[2] abc[0] abc 0 abc[1] abc 1 abc[2] abc 2 max lastmax System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int abc[] = new int[3];
        for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        }

        int bai = sc.nextInt();
        int last=1;
        for(int i=1;i<=bai;i++) {
            last = last * 2;
        }
        int max=0;

        for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        }
        int lastmax=max*last;
        int ans=abc[0]+abc[1]+abc[2]-max+lastmax;
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int abc[] = new int[3];
        for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        }

        int bai = sc.nextInt();
        int last=1;
        for(int i=1;i<=bai;i++) {
            last = last * 2;
        }
        int max=0;

        for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        }
        int lastmax=max*last;
        int ans=abc[0]+abc[1]+abc[2]-max+lastmax;
        System.out.println(ans);
    }
} Main
import java.util.*;
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int abc[] = new int[3];
        for(int i=0;i<3;i++){
            abc[i]=sc.nextInt();
        }

        int bai = sc.nextInt();
        int last=1;
        for(int i=1;i<=bai;i++) {
            last = last * 2;
        }
        int max=0;

        for(int i=0;i<3;i++){
            max=Math.max(max,abc[i]);
        }
        int lastmax=max*last;
        int ans=abc[0]+abc[1]+abc[2]-max+lastmax;
        System.out.println(ans);
    }
}