import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long[] a = new long[3];
        a[0] = in.nextLong(); a[1] = in.nextLong(); a[2] = in.nextLong();
        int k = in.nextInt();
        Arrays.sort(a);
        a[2] = a[2] * (long)Math.pow(2, k);
        System.out.println(a[0] + a[1] + a[2]);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long[] a = new long[3];
        a[0] = in.nextLong(); a[1] = in.nextLong(); a[2] = in.nextLong();
        int k = in.nextInt();
        Arrays.sort(a);
        a[2] = a[2] * (long)Math.pow(2, k);
        System.out.println(a[0] + a[1] + a[2]);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long[] a = new long[3];
        a[0] = in.nextLong(); a[1] = in.nextLong(); a[2] = in.nextLong();
        int k = in.nextInt();
        Arrays.sort(a);
        a[2] = a[2] * (long)Math.pow(2, k);
        System.out.println(a[0] + a[1] + a[2]);
    } main {
        Scanner in = new Scanner(System.in);
        long[] a = new long[3];
        a[0] = in.nextLong(); a[1] = in.nextLong(); a[2] = in.nextLong();
        int k = in.nextInt();
        Arrays.sort(a);
        a[2] = a[2] * (long)Math.pow(2, k);
        System.out.println(a[0] + a[1] + a[2]);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) long[] a = new long[3]; a new long[3] 3 a[0] = in.nextLong() a[0] a 0 in.nextLong() in.nextLong in a[1] = in.nextLong() a[1] a 1 in.nextLong() in.nextLong in a[2] = in.nextLong() a[2] a 2 in.nextLong() in.nextLong in int k = in.nextInt(); k in.nextInt() in.nextInt in Arrays.sort(a) Arrays.sort Arrays a a[2] = a[2] * (long)Math.pow(2, k) a[2] a 2 a[2] * (long)Math.pow(2, k) a[2] a 2 (long)Math.pow(2, k) Math.pow Math 2 k System.out.println(a[0] + a[1] + a[2]) System.out.println System.out System System.out a[0] + a[1] + a[2] a[0] + a[1] + a[2] a[0] a 0 a[1] a 1 a[2] a 2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long[] a = new long[3];
        a[0] = in.nextLong(); a[1] = in.nextLong(); a[2] = in.nextLong();
        int k = in.nextInt();
        Arrays.sort(a);
        a[2] = a[2] * (long)Math.pow(2, k);
        System.out.println(a[0] + a[1] + a[2]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long[] a = new long[3];
        a[0] = in.nextLong(); a[1] = in.nextLong(); a[2] = in.nextLong();
        int k = in.nextInt();
        Arrays.sort(a);
        a[2] = a[2] * (long)Math.pow(2, k);
        System.out.println(a[0] + a[1] + a[2]);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long[] a = new long[3];
        a[0] = in.nextLong(); a[1] = in.nextLong(); a[2] = in.nextLong();
        int k = in.nextInt();
        Arrays.sort(a);
        a[2] = a[2] * (long)Math.pow(2, k);
        System.out.println(a[0] + a[1] + a[2]);
    }
}