import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int max=0,K,n=0;
        int [] num = new int[3];
        for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        }
        K=sc.nextInt();
        for(int b=0;b<K;b++){
            num[n] *=2;
        }
        int sum=0;
        for(int a=0;a<3;a++) {
            sum += num[a];
        }
        System.out.println(sum);

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int max=0,K,n=0;
        int [] num = new int[3];
        for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        }
        K=sc.nextInt();
        for(int b=0;b<K;b++){
            num[n] *=2;
        }
        int sum=0;
        for(int a=0;a<3;a++) {
            sum += num[a];
        }
        System.out.println(sum);

    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int max=0,K,n=0;
        int [] num = new int[3];
        for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        }
        K=sc.nextInt();
        for(int b=0;b<K;b++){
            num[n] *=2;
        }
        int sum=0;
        for(int a=0;a<3;a++) {
            sum += num[a];
        }
        System.out.println(sum);

    } main {
        Scanner sc = new Scanner(System.in);
        int max=0,K,n=0;
        int [] num = new int[3];
        for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        }
        K=sc.nextInt();
        for(int b=0;b<K;b++){
            num[n] *=2;
        }
        int sum=0;
        for(int a=0;a<3;a++) {
            sum += num[a];
        }
        System.out.println(sum);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int max=0 max 0 K K n=0; n 0 int [] num = new int[3]; num new int[3] 3 for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        } int a=0; int a=0; a 0 a<3 a 3 a++ a++ a {
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        } {
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        } num[a] = sc.nextInt() num[a] num a sc.nextInt() sc.nextInt sc if(num[a]>max) {
                max =num[a];
                n=a;
            } num[a]>max num[a] num a max {
                max =num[a];
                n=a;
            } max =num[a] max num[a] num a n=a n a K=sc.nextInt() K sc.nextInt() sc.nextInt sc for(int b=0;b<K;b++){
            num[n] *=2;
        } int b=0; int b=0; b 0 b<K b K b++ b++ b {
            num[n] *=2;
        } {
            num[n] *=2;
        } num[n] *=2 num[n] num n 2 int sum=0; sum 0 for(int a=0;a<3;a++) {
            sum += num[a];
        } int a=0; int a=0; a 0 a<3 a 3 a++ a++ a {
            sum += num[a];
        } {
            sum += num[a];
        } sum += num[a] sum num[a] num a System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int max=0,K,n=0;
        int [] num = new int[3];
        for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        }
        K=sc.nextInt();
        for(int b=0;b<K;b++){
            num[n] *=2;
        }
        int sum=0;
        for(int a=0;a<3;a++) {
            sum += num[a];
        }
        System.out.println(sum);

    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int max=0,K,n=0;
        int [] num = new int[3];
        for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        }
        K=sc.nextInt();
        for(int b=0;b<K;b++){
            num[n] *=2;
        }
        int sum=0;
        for(int a=0;a<3;a++) {
            sum += num[a];
        }
        System.out.println(sum);

    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int max=0,K,n=0;
        int [] num = new int[3];
        for(int a=0;a<3;a++){
            num[a] = sc.nextInt();
            if(num[a]>max) {
                max =num[a];
                n=a;
            }
        }
        K=sc.nextInt();
        for(int b=0;b<K;b++){
            num[n] *=2;
        }
        int sum=0;
        for(int a=0;a<3;a++) {
            sum += num[a];
        }
        System.out.println(sum);

    }
}
