import java.util.Scanner;
import java.lang.Math;

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

        int[] array = {a,b,c};
        for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util import java.lang.Math; Math java.lang public class Main {
    public static void main(String args[]) {
        int a, b, c, k;
        int max = 0;
        int sum = 0;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        k = sc.nextInt();

        int[] array = {a,b,c};
        for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        System.out.println(sum);
    }
} Main public static void main(String args[]) {
        int a, b, c, k;
        int max = 0;
        int sum = 0;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        k = sc.nextInt();

        int[] array = {a,b,c};
        for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        System.out.println(sum);
    } main {
        int a, b, c, k;
        int max = 0;
        int sum = 0;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        k = sc.nextInt();

        int[] array = {a,b,c};
        for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        System.out.println(sum);
    } int a a b b c c k; k int max = 0; max 0 int sum = 0; sum 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt() b sc.nextInt() sc.nextInt sc c = sc.nextInt() c sc.nextInt() sc.nextInt sc k = sc.nextInt() k sc.nextInt() sc.nextInt sc int[] array = {a,b,c}; array {a,b,c} a b c for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        } int i = 1; int i = 1; i 1 i <= k i k i++ i++ i {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        } {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        } for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            } int j = 0; int j = 0; j 0 j < array.length j array.length array array.length j++ j++ j {
                max = Math.max(max,array[j]);
            } {
                max = Math.max(max,array[j]);
            } max = Math.max(max,array[j]) max Math.max(max,array[j]) Math.max Math max array[j] array j for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            } int j = 0; int j = 0; j 0 j < array.length j array.length array array.length j++ j++ j {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            } {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            } if (max == array[j]) {
                    array[j] *= 2;
                    break;
                } max == array[j] max array[j] array j {
                    array[j] *= 2;
                    break;
                } array[j] *= 2 array[j] array j 2 break; for (int i = 0; i < array.length; i++) {
            sum += array[i];
        } int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
            sum += array[i];
        } {
            sum += array[i];
        } sum += array[i] sum array[i] array 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[]) {
        int a, b, c, k;
        int max = 0;
        int sum = 0;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        k = sc.nextInt();

        int[] array = {a,b,c};
        for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String args[]) {
        int a, b, c, k;
        int max = 0;
        int sum = 0;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        k = sc.nextInt();

        int[] array = {a,b,c};
        for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        System.out.println(sum);
    }
} Main
import java.util.Scanner;
import java.lang.Math;

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

        int[] array = {a,b,c};
        for (int i = 1; i <= k; i++) {
            for (int j = 0; j < array.length; j++) {
                max = Math.max(max,array[j]);
            }
            for (int j = 0; j < array.length; j++) {
                if (max == array[j]) {
                    array[j] *= 2;
                    break;
                }
            }
        }
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        System.out.println(sum);
    }
}
