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 n = 0;
        for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        }
        for(int i = 0;i < k;i++){
            x[n] *= 2;
        }
        int sum = 0;
        for(int i = 0;i < 3;i++){
            sum += x[i];
        }

        System.out.println(sum);
    }
} 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 n = 0;
        for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        }
        for(int i = 0;i < k;i++){
            x[n] *= 2;
        }
        int sum = 0;
        for(int i = 0;i < 3;i++){
            sum += x[i];
        }

        System.out.println(sum);
    }
} 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 n = 0;
        for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        }
        for(int i = 0;i < k;i++){
            x[n] *= 2;
        }
        int sum = 0;
        for(int i = 0;i < 3;i++){
            sum += x[i];
        }

        System.out.println(sum);
    } 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 n = 0;
        for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        }
        for(int i = 0;i < k;i++){
            x[n] *= 2;
        }
        int sum = 0;
        for(int i = 0;i < 3;i++){
            sum += x[i];
        }

        System.out.println(sum);
    } 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 n = 0; n 0 for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        } {
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        } if(max < x[i]){
                max = x[i];
                n = i;
            } max < x[i] max x[i] x i {
                max = x[i];
                n = i;
            } max = x[i] max x[i] x i n = i n i for(int i = 0;i < k;i++){
            x[n] *= 2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            x[n] *= 2;
        } {
            x[n] *= 2;
        } x[n] *= 2 x[n] x n 2 int sum = 0; sum 0 for(int i = 0;i < 3;i++){
            sum += x[i];
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            sum += x[i];
        } {
            sum += x[i];
        } sum += x[i] sum x[i] x i 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 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 n = 0;
        for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        }
        for(int i = 0;i < k;i++){
            x[n] *= 2;
        }
        int sum = 0;
        for(int i = 0;i < 3;i++){
            sum += x[i];
        }

        System.out.println(sum);
    }
} 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 n = 0;
        for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        }
        for(int i = 0;i < k;i++){
            x[n] *= 2;
        }
        int sum = 0;
        for(int i = 0;i < 3;i++){
            sum += x[i];
        }

        System.out.println(sum);
    }
} 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 n = 0;
        for(int i = 0;i < 3;i++){
            if(max < x[i]){
                max = x[i];
                n = i;
            }
        }
        for(int i = 0;i < k;i++){
            x[n] *= 2;
        }
        int sum = 0;
        for(int i = 0;i < 3;i++){
            sum += x[i];
        }

        System.out.println(sum);
    }
}