import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main a = new Main();
        a.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int max = Math.max(Math.max(a,b),c);
        int answer = a+b+c - max + max * (int) Math.pow(2, k);
        System.out.println(answer);
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main a = new Main();
        a.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int max = Math.max(Math.max(a,b),c);
        int answer = a+b+c - max + max * (int) Math.pow(2, k);
        System.out.println(answer);
    }

} Main public static void main(String[] args) {
        Main a = new Main();
        a.solve();
    } main {
        Main a = new Main();
        a.solve();
    } Main a = new Main(); a new Main() a.solve() a.solve a String[] args args public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int max = Math.max(Math.max(a,b),c);
        int answer = a+b+c - max + max * (int) Math.pow(2, k);
        System.out.println(answer);
    } solve {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int max = Math.max(Math.max(a,b),c);
        int answer = a+b+c - max + max * (int) Math.pow(2, k);
        System.out.println(answer);
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int c = scan.nextInt(); c scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan 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 int answer = a+b+c - max + max * (int) Math.pow(2, k); answer 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 System.out.println(answer) System.out.println System.out System System.out answer public class Main {
    public static void main(String[] args) {
        Main a = new Main();
        a.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int max = Math.max(Math.max(a,b),c);
        int answer = a+b+c - max + max * (int) Math.pow(2, k);
        System.out.println(answer);
    }

} public class Main {
    public static void main(String[] args) {
        Main a = new Main();
        a.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int max = Math.max(Math.max(a,b),c);
        int answer = a+b+c - max + max * (int) Math.pow(2, k);
        System.out.println(answer);
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main a = new Main();
        a.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        int k = scan.nextInt();
        int max = Math.max(Math.max(a,b),c);
        int answer = a+b+c - max + max * (int) Math.pow(2, k);
        System.out.println(answer);
    }

}
