import java.util.*;

public class Main{

    public static void main(String[] args){
        
        Scanner scan = new Scanner(System.in);

        int a,b,c,k,max,max_;
        a = Integer.parseInt(scan.next());   
        b = Integer.parseInt(scan.next());
        c = Integer.parseInt(scan.next());
        k = Integer.parseInt(scan.next());
        max = Math.max(a,b);
        max = Math.max(max,c);
        max_ = max;
        for(int i = 0;i < k;i++){
            max = max*2;
        }
        int ans;
        ans = max + a + b + c - max_;

        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main{

    public static void main(String[] args){
        
        Scanner scan = new Scanner(System.in);

        int a,b,c,k,max,max_;
        a = Integer.parseInt(scan.next());   
        b = Integer.parseInt(scan.next());
        c = Integer.parseInt(scan.next());
        k = Integer.parseInt(scan.next());
        max = Math.max(a,b);
        max = Math.max(max,c);
        max_ = max;
        for(int i = 0;i < k;i++){
            max = max*2;
        }
        int ans;
        ans = max + a + b + c - max_;

        System.out.println(ans);
    }
} Main public static void main(String[] args){
        
        Scanner scan = new Scanner(System.in);

        int a,b,c,k,max,max_;
        a = Integer.parseInt(scan.next());   
        b = Integer.parseInt(scan.next());
        c = Integer.parseInt(scan.next());
        k = Integer.parseInt(scan.next());
        max = Math.max(a,b);
        max = Math.max(max,c);
        max_ = max;
        for(int i = 0;i < k;i++){
            max = max*2;
        }
        int ans;
        ans = max + a + b + c - max_;

        System.out.println(ans);
    } main {
        
        Scanner scan = new Scanner(System.in);

        int a,b,c,k,max,max_;
        a = Integer.parseInt(scan.next());   
        b = Integer.parseInt(scan.next());
        c = Integer.parseInt(scan.next());
        k = Integer.parseInt(scan.next());
        max = Math.max(a,b);
        max = Math.max(max,c);
        max_ = max;
        for(int i = 0;i < k;i++){
            max = max*2;
        }
        int ans;
        ans = max + a + b + c - max_;

        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a a b b c c k k max max max_; max_ a = Integer.parseInt(scan.next()) a Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan b = Integer.parseInt(scan.next()) b Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan c = Integer.parseInt(scan.next()) c Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan k = Integer.parseInt(scan.next()) k Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan max = Math.max(a,b) max Math.max(a,b) Math.max Math a b max = Math.max(max,c) max Math.max(max,c) Math.max Math max c max_ = max max_ max for(int i = 0;i < k;i++){
            max = max*2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            max = max*2;
        } {
            max = max*2;
        } max = max*2 max max*2 max 2 int ans; ans ans = max + a + b + c - max_ ans max + a + b + c - max_ max + a + b + c b max + a + b + c max a b c max_ 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 scan = new Scanner(System.in);

        int a,b,c,k,max,max_;
        a = Integer.parseInt(scan.next());   
        b = Integer.parseInt(scan.next());
        c = Integer.parseInt(scan.next());
        k = Integer.parseInt(scan.next());
        max = Math.max(a,b);
        max = Math.max(max,c);
        max_ = max;
        for(int i = 0;i < k;i++){
            max = max*2;
        }
        int ans;
        ans = max + a + b + c - max_;

        System.out.println(ans);
    }
} public class Main{

    public static void main(String[] args){
        
        Scanner scan = new Scanner(System.in);

        int a,b,c,k,max,max_;
        a = Integer.parseInt(scan.next());   
        b = Integer.parseInt(scan.next());
        c = Integer.parseInt(scan.next());
        k = Integer.parseInt(scan.next());
        max = Math.max(a,b);
        max = Math.max(max,c);
        max_ = max;
        for(int i = 0;i < k;i++){
            max = max*2;
        }
        int ans;
        ans = max + a + b + c - max_;

        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main{

    public static void main(String[] args){
        
        Scanner scan = new Scanner(System.in);

        int a,b,c,k,max,max_;
        a = Integer.parseInt(scan.next());   
        b = Integer.parseInt(scan.next());
        c = Integer.parseInt(scan.next());
        k = Integer.parseInt(scan.next());
        max = Math.max(a,b);
        max = Math.max(max,c);
        max_ = max;
        for(int i = 0;i < k;i++){
            max = max*2;
        }
        int ans;
        ans = max + a + b + c - max_;

        System.out.println(ans);
    }
}