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
 *
 * @author Kenji
 */
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);
        ABC096B solver = new ABC096B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        }

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

    static class ABC096B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        }

    }
} 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);
        ABC096B solver = new ABC096B();
        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);
        ABC096B solver = new ABC096B();
        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) ABC096B solver = new ABC096B(); solver new ABC096B() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class ABC096B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        }

    } ABC096B public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        } solve {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        } 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 m = Math.max(A, Math.max(B, C)); m Math.max(A, Math.max(B, C)) Math.max Math A Math.max(B, C) Math.max Math B C int n = A + B + C - m; n A + B + C - m A + B + C A + B + C A B C m for (int i = 0; i < K; i++) {
                m = m * 2;
            } int i = 0; int i = 0; i 0 i < K i K i++ i++ i {
                m = m * 2;
            } {
                m = m * 2;
            } m = m * 2 m m * 2 m 2 out.println(m + n) out.println out m + n m n 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);
        ABC096B solver = new ABC096B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        }

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

    static class ABC096B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        }

    }
} 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
 *
 * @author Kenji
 */
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);
        ABC096B solver = new ABC096B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC096B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int K = in.nextInt();
            int m = Math.max(A, Math.max(B, C));
            int n = A + B + C - m;
            for (int i = 0; i < K; i++) {
                m = m * 2;
            }
            out.println(m + n);
        }

    }
}

