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);
        ABC096_B solver = new ABC096_B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096_B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        }

    }
}
 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);
        ABC096_B solver = new ABC096_B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096_B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        }

    }
} 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);
        ABC096_B solver = new ABC096_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);
        ABC096_B solver = new ABC096_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) ABC096_B solver = new ABC096_B(); solver new ABC096_B() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class ABC096_B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        }

    } ABC096_B public void solve(int testNumber, Scanner in, PrintWriter out) {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        } solve {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        } int ans = 0; ans 0 int a = in.nextInt(); a in.nextInt() in.nextInt in int b = in.nextInt(); b in.nextInt() in.nextInt in int c = in.nextInt(); c in.nextInt() in.nextInt in int k = in.nextInt(); k in.nextInt() in.nextInt in int doubled = Math.max(Math.max(a, b), c); doubled Math.max(Math.max(a, b), c) Math.max Math Math.max(a, b) Math.max Math a b c for (int i = 0; i < k; i++) {
                doubled *= 2;
            } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
                doubled *= 2;
            } {
                doubled *= 2;
            } doubled *= 2 doubled 2 out.print(a + b + c + doubled - Math.max(Math.max(a, b), c)) out.print out a + b + c + doubled - Math.max(Math.max(a, b), c) a + b + c + doubled c a + b + c + doubled a b c doubled Math.max(Math.max(a, b), c) Math.max Math Math.max(a, b) Math.max Math a b c 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);
        ABC096_B solver = new ABC096_B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096_B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        }

    }
} 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);
        ABC096_B solver = new ABC096_B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096_B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        }

    }
} 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);
        ABC096_B solver = new ABC096_B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096_B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int ans = 0;
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int k = in.nextInt();

            int doubled = Math.max(Math.max(a, b), c);
            for (int i = 0; i < k; i++) {
                doubled *= 2;
            }

            out.print(a + b + c + doubled - Math.max(Math.max(a, b), c));
        }

    }
}

