import java.util.Scanner;

public class Main {

    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());

        System.out.println(solve(a, b, c, k));
    }

    static int solve(int a, int b, int c, int k) {
        int max = Math.max(Math.max(a, b), c);
        return (a + b + c - max) + max * (int)Math.pow(2, k);

    }
} import java.util.Scanner; Scanner java.util public class Main {

    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());

        System.out.println(solve(a, b, c, k));
    }

    static int solve(int a, int b, int c, int k) {
        int max = Math.max(Math.max(a, b), c);
        return (a + b + c - max) + max * (int)Math.pow(2, k);

    }
} Main 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());

        System.out.println(solve(a, b, c, k));
    } 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());

        System.out.println(solve(a, b, c, k));
    } 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 System.out.println(solve(a, b, c, k)) System.out.println System.out System System.out solve(a, b, c, k) solve a b c k String[] args args static int solve(int a, int b, int c, int k) {
        int max = Math.max(Math.max(a, b), c);
        return (a + b + c - max) + max * (int)Math.pow(2, k);

    } solve {
        int max = Math.max(Math.max(a, b), c);
        return (a + b + c - max) + max * (int)Math.pow(2, k);

    } int max = Math.max(Math.max(a, b), c); max Math.max(Math.max(a, b), c) Math.max Math Math.max(a, b) Math.max Math a b c return (a + b + c - max) + max * (int)Math.pow(2, k); (a + b + c - max) + max * (int)Math.pow(2, k) (a + b + c - max) a + b + c a + b + c a b c max max * (int)Math.pow(2, k) max (int)Math.pow(2, k) Math.pow Math 2 k int a a int b b int c c int k k public class Main {

    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());

        System.out.println(solve(a, b, c, k));
    }

    static int solve(int a, int b, int c, int k) {
        int max = Math.max(Math.max(a, b), c);
        return (a + b + c - max) + max * (int)Math.pow(2, k);

    }
} public class Main {

    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());

        System.out.println(solve(a, b, c, k));
    }

    static int solve(int a, int b, int c, int k) {
        int max = Math.max(Math.max(a, b), c);
        return (a + b + c - max) + max * (int)Math.pow(2, k);

    }
} Main
import java.util.Scanner;

public class Main {

    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());

        System.out.println(solve(a, b, c, k));
    }

    static int solve(int a, int b, int c, int k) {
        int max = Math.max(Math.max(a, b), c);
        return (a + b + c - max) + max * (int)Math.pow(2, k);

    }
}