import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    public static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    }
} Main public static final int MOD = 1000000007; MOD 1000000007 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    } main {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] ary = {a, b, c}; ary {a, b, c} a b c Arrays.sort(ary) Arrays.sort Arrays ary ary[2] *= Math.pow(2, k) ary[2] ary 2 Math.pow(2, k) Math.pow Math 2 k System.out.println(Arrays.stream(ary).sum()) System.out.println System.out System System.out Arrays.stream(ary).sum() Arrays.stream(ary).sum Arrays.stream(ary) Arrays.stream Arrays ary String[] args args public class Main {

    public static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    }
} public class Main {

    public static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] ary = {a, b, c};
        Arrays.sort(ary);
        ary[2] *= Math.pow(2, k);
        System.out.println(Arrays.stream(ary).sum());
    }
}