import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) B solver = new B(); solver new B() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        }

    } B public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        } solve {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        } int a = Integer.parseInt(in.next()); a Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int b = Integer.parseInt(in.next()); b Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int c = Integer.parseInt(in.next()); c Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int k = Integer.parseInt(in.next()); k Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int ans = 0; ans 0 int mx = 0; mx 0 int cnt = 0; cnt 0 mx = Math.max(a, Math.max(b, c)) mx Math.max(a, Math.max(b, c)) Math.max Math a Math.max(b, c) Math.max Math b c if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            } mx == a mx a {
                cnt = 1;
            } cnt = 1 cnt 1 if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            } mx == c mx c {
                mx = c;
                cnt = 3;
            } mx = c mx c cnt = 3 cnt 3 {
                mx = b;
                cnt = 2;
            } mx = b mx b cnt = 2 cnt 2 for (int i = 0; i < k; i++) {
                mx *= 2;
            } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
                mx *= 2;
            } {
                mx *= 2;
            } mx *= 2 mx 2 if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            } cnt == 1 cnt 1 {
                ans = mx + b + c;
            } ans = mx + b + c ans mx + b + c mx + b + c mx b c if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            } cnt == 2 cnt 2 {
                ans = a + mx + c;
            } ans = a + mx + c ans a + mx + c a + mx + c a mx c {
                ans = a + b + mx;
            } ans = a + b + mx ans a + b + mx a + b + mx a b mx out.println(ans) out.println out ans int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int c = Integer.parseInt(in.next());
            int k = Integer.parseInt(in.next());
            int ans = 0;

            int mx = 0;
            int cnt = 0;
            mx = Math.max(a, Math.max(b, c));
            if (mx == a) {
                cnt = 1;
            } else if (mx == c) {
                mx = c;
                cnt = 3;
            } else {
                mx = b;
                cnt = 2;
            }
            for (int i = 0; i < k; i++) {
                mx *= 2;
            }

            if (cnt == 1) {
                ans = mx + b + c;
            } else if (cnt == 2) {
                ans = a + mx + c;
            } else {
                ans = a + b + mx;
            }
            // 出力
            out.println(ans);

        }

    }
}

