import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = sc.nextInt();

        int max = Math.max(a, b);
        max = Math.max(max, c);
        int sum = 0;

        if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        }

        sum = a + b + c;
        System.out.println(sum);
    }

    public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    }

    public static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    public static int lcm(int a, int b){
        return a * b / gcd(a, b);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = sc.nextInt();

        int max = Math.max(a, b);
        max = Math.max(max, c);
        int sum = 0;

        if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        }

        sum = a + b + c;
        System.out.println(sum);
    }

    public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    }

    public static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    public static int lcm(int a, int b){
        return a * b / gcd(a, b);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = sc.nextInt();

        int max = Math.max(a, b);
        max = Math.max(max, c);
        int sum = 0;

        if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        }

        sum = a + b + c;
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = sc.nextInt();

        int max = Math.max(a, b);
        max = Math.max(max, c);
        int sum = 0;

        if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        }

        sum = a + b + c;
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int 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 int sum = 0; sum 0 if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        } max == a max a {
            for(int i=0; i<n; i++){
                a*=2;
            }
        } for(int i=0; i<n; i++){
                a*=2;
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                a*=2;
            } {
                a*=2;
            } a*=2 a 2 if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        } max == b max b {
            for(int i=0; i<n; i++){
                b*=2;
            }
        } for(int i=0; i<n; i++){
                b*=2;
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                b*=2;
            } {
                b*=2;
            } b*=2 b 2 {
            for(int i=0; i<n; i++){
                c*=2;
            }
        } for(int i=0; i<n; i++){
                c*=2;
            } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                c*=2;
            } {
                c*=2;
            } c*=2 c 2 sum = a + b + c sum a + b + c a + b + c a b c System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    } printArray {
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    } for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        } int i=0; int i=0; i 0 i<array.length i array.length array array.length i++ i++ i {
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        } {
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        } if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            } i == array.length i array.length array array.length {
                System.out.println(array[i]);
            } System.out.println(array[i]) System.out.println System.out System System.out array[i] array i {
                System.out.print(String.format("%d ", array[i]));
            } System.out.print(String.format("%d ", array[i])) System.out.print System.out System System.out String.format("%d ", array[i]) String.format String "%d " array[i] array i int[] array array public static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    } gcd {
        if (b == 0) return a;
        return gcd(b, a % b);
    } if (b == 0) return a; b == 0 b 0 return a; a return gcd(b, a % b); gcd(b, a % b) gcd b a % b a b int a a int b b public static int lcm(int a, int b){
        return a * b / gcd(a, b);
    } lcm {
        return a * b / gcd(a, b);
    } return a * b / gcd(a, b); a * b / gcd(a, b) a * b a b gcd(a, b) gcd a b int a a int b b public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = sc.nextInt();

        int max = Math.max(a, b);
        max = Math.max(max, c);
        int sum = 0;

        if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        }

        sum = a + b + c;
        System.out.println(sum);
    }

    public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    }

    public static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    public static int lcm(int a, int b){
        return a * b / gcd(a, b);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = sc.nextInt();

        int max = Math.max(a, b);
        max = Math.max(max, c);
        int sum = 0;

        if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        }

        sum = a + b + c;
        System.out.println(sum);
    }

    public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    }

    public static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    public static int lcm(int a, int b){
        return a * b / gcd(a, b);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int n = sc.nextInt();

        int max = Math.max(a, b);
        max = Math.max(max, c);
        int sum = 0;

        if(max == a){
            for(int i=0; i<n; i++){
                a*=2;
            }
        } else if(max == b){
            for(int i=0; i<n; i++){
                b*=2;
            }
        } else {
            for(int i=0; i<n; i++){
                c*=2;
            }
        }

        sum = a + b + c;
        System.out.println(sum);
    }

    public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    }

    public static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    public static int lcm(int a, int b){
        return a * b / gcd(a, b);
    }
}
