import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> abc = new ArrayList<>();
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        Collections.sort(abc);
        int k = sc.nextInt();
        System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)));
    }

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> abc = new ArrayList<>();
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        Collections.sort(abc);
        int k = sc.nextInt();
        System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)));
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> abc = new ArrayList<>();
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        Collections.sort(abc);
        int k = sc.nextInt();
        System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)));
    } main {
        Scanner sc = new Scanner(System.in);
        List<Integer> abc = new ArrayList<>();
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        Collections.sort(abc);
        int k = sc.nextInt();
        System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Integer> abc = new ArrayList<>(); abc new ArrayList<>() abc.add(sc.nextInt()) abc.add abc sc.nextInt() sc.nextInt sc abc.add(sc.nextInt()) abc.add abc sc.nextInt() sc.nextInt sc abc.add(sc.nextInt()) abc.add abc sc.nextInt() sc.nextInt sc Collections.sort(abc) Collections.sort Collections abc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k))) System.out.println System.out System System.out (int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)) abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k) abc.get(0) abc.get abc 0 abc.get(1) abc.get abc 1 abc.get(2) * Math.pow(2, k) abc.get(2) abc.get abc 2 Math.pow(2, k) Math.pow Math 2 k String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> abc = new ArrayList<>();
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        Collections.sort(abc);
        int k = sc.nextInt();
        System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)));
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> abc = new ArrayList<>();
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        Collections.sort(abc);
        int k = sc.nextInt();
        System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)));
    }

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> abc = new ArrayList<>();
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        abc.add(sc.nextInt());
        Collections.sort(abc);
        int k = sc.nextInt();
        System.out.println((int) (abc.get(0) + abc.get(1) + abc.get(2) * Math.pow(2, k)));
    }

}
