import java.util.*;

import static java.lang.Math.pow;
import static sun.swing.MenuItemLayoutHelper.max;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int tmp = max(a, b, c);
        int ans = a + b + c - tmp;
        ans += tmp * Math.pow(2.0, (double) k);
        System.out.println(ans);
    }

} import java.util.*; util.* java import static java.lang.Math.pow; import static java.lang.Math.pow; import static java.lang.Math.pow; import static sun.swing.MenuItemLayoutHelper.max; import static sun.swing.MenuItemLayoutHelper.max; import static sun.swing.MenuItemLayoutHelper.max; public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int tmp = max(a, b, c);
        int ans = a + b + c - tmp;
        ans += tmp * Math.pow(2.0, (double) k);
        System.out.println(ans);
    }

} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int tmp = max(a, b, c);
        int ans = a + b + c - tmp;
        ans += tmp * Math.pow(2.0, (double) k);
        System.out.println(ans);
    } main {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int tmp = max(a, b, c);
        int ans = a + b + c - tmp;
        ans += tmp * Math.pow(2.0, (double) k);
        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan int tmp = max(a, b, c); tmp max(a, b, c) max a b c int ans = a + b + c - tmp; ans a + b + c - tmp a + b + c a + b + c a b c tmp ans += tmp * Math.pow(2.0, (double) k) ans tmp * Math.pow(2.0, (double) k) tmp Math.pow(2.0, (double) k) Math.pow Math 2.0 (double) k System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int tmp = max(a, b, c);
        int ans = a + b + c - tmp;
        ans += tmp * Math.pow(2.0, (double) k);
        System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int tmp = max(a, b, c);
        int ans = a + b + c - tmp;
        ans += tmp * Math.pow(2.0, (double) k);
        System.out.println(ans);
    }

} Main
import java.util.*;

import static java.lang.Math.pow;
import static sun.swing.MenuItemLayoutHelper.max;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int tmp = max(a, b, c);
        int ans = a + b + c - tmp;
        ans += tmp * Math.pow(2.0, (double) k);
        System.out.println(ans);
    }

}
