import java.util.Scanner;

public class Main {

    public static  void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int x[] = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        }
        int k = scanner.nextInt();
        int max = 0;
        int max_val = 0;
        for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        }
        for(int i = 0; i < k; i++){
            max_val += max_val;
        }
        int ans = 0;
        for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        }
        System.out.println(ans + max_val);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static  void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int x[] = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        }
        int k = scanner.nextInt();
        int max = 0;
        int max_val = 0;
        for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        }
        for(int i = 0; i < k; i++){
            max_val += max_val;
        }
        int ans = 0;
        for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        }
        System.out.println(ans + max_val);
    }
} Main public static  void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int x[] = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        }
        int k = scanner.nextInt();
        int max = 0;
        int max_val = 0;
        for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        }
        for(int i = 0; i < k; i++){
            max_val += max_val;
        }
        int ans = 0;
        for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        }
        System.out.println(ans + max_val);
    } main {
        Scanner scanner = new Scanner(System.in);
        int x[] = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        }
        int k = scanner.nextInt();
        int max = 0;
        int max_val = 0;
        for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        }
        for(int i = 0; i < k; i++){
            max_val += max_val;
        }
        int ans = 0;
        for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        }
        System.out.println(ans + max_val);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int x[] = new int[3]; x new int[3] 3 for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            x[i] = scanner.nextInt();
        } {
            x[i] = scanner.nextInt();
        } x[i] = scanner.nextInt() x[i] x i scanner.nextInt() scanner.nextInt scanner int k = scanner.nextInt(); k scanner.nextInt() scanner.nextInt scanner int max = 0; max 0 int max_val = 0; max_val 0 for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        } {
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        } if(max_val < x[i]){
                max_val = x[i];
                max = i;
            } max_val < x[i] max_val x[i] x i {
                max_val = x[i];
                max = i;
            } max_val = x[i] max_val x[i] x i max = i max i for(int i = 0; i < k; i++){
            max_val += max_val;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            max_val += max_val;
        } {
            max_val += max_val;
        } max_val += max_val max_val max_val int ans = 0; ans 0 for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if(i != max){
                ans += x[i];
            }
        } {
            if(i != max){
                ans += x[i];
            }
        } if(i != max){
                ans += x[i];
            } i != max i max {
                ans += x[i];
            } ans += x[i] ans x[i] x i System.out.println(ans + max_val) System.out.println System.out System System.out ans + max_val ans max_val String args[] args public class Main {

    public static  void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int x[] = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        }
        int k = scanner.nextInt();
        int max = 0;
        int max_val = 0;
        for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        }
        for(int i = 0; i < k; i++){
            max_val += max_val;
        }
        int ans = 0;
        for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        }
        System.out.println(ans + max_val);
    }
} public class Main {

    public static  void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int x[] = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        }
        int k = scanner.nextInt();
        int max = 0;
        int max_val = 0;
        for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        }
        for(int i = 0; i < k; i++){
            max_val += max_val;
        }
        int ans = 0;
        for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        }
        System.out.println(ans + max_val);
    }
} Main
import java.util.Scanner;

public class Main {

    public static  void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int x[] = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scanner.nextInt();
        }
        int k = scanner.nextInt();
        int max = 0;
        int max_val = 0;
        for(int i = 0; i < 3; i++){
            if(max_val < x[i]){
                max_val = x[i];
                max = i;
            }
        }
        for(int i = 0; i < k; i++){
            max_val += max_val;
        }
        int ans = 0;
        for(int i = 0; i < 3; i++){
            if(i != max){
                ans += x[i];
            }
        }
        System.out.println(ans + max_val);
    }
}
