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

public class Main{
	public static void main(String[] args){
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner sc = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    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 max = (int)Math.max(A, Math.max(B, C));
	out.println(A + B + C + max * ((1 << K) - 1));
    out.close();
    }
} 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 sc = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    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 max = (int)Math.max(A, Math.max(B, C));
	out.println(A + B + C + max * ((1 << K) - 1));
    out.close();
    }
} Main public static void main(String[] args){
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner sc = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    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 max = (int)Math.max(A, Math.max(B, C));
	out.println(A + B + C + max * ((1 << K) - 1));
    out.close();
    } main {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner sc = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    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 max = (int)Math.max(A, Math.max(B, C));
	out.println(A + B + C + max * ((1 << K) - 1));
    out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner sc = new Scanner(inputStream); sc new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) 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 max = (int)Math.max(A, Math.max(B, C)); max (int)Math.max(A, Math.max(B, C)) Math.max Math A Math.max(B, C) Math.max Math B C out.println(A + B + C + max * ((1 << K) - 1)) out.println out A + B + C + max * ((1 << K) - 1) C A + B + C + max * ((1 << K) - 1) A B C max * ((1 << K) - 1) max ((1 << K) - 1) (1 << K) 1 K 1 out.close() out.close out String[] args args public class Main{
	public static void main(String[] args){
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner sc = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    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 max = (int)Math.max(A, Math.max(B, C));
	out.println(A + B + C + max * ((1 << K) - 1));
    out.close();
    }
} public class Main{
	public static void main(String[] args){
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner sc = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    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 max = (int)Math.max(A, Math.max(B, C));
	out.println(A + B + C + max * ((1 << K) - 1));
    out.close();
    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner sc = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    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 max = (int)Math.max(A, Math.max(B, C));
	out.println(A + B + C + max * ((1 << K) - 1));
    out.close();
    }
}