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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            list.add(sc.nextInt());
        }
        int k = sc.nextInt();
        int max = Collections.max(list);
        for (int i = 0; i < k; i++) {
            max *= 2;
        }
        Collections.sort(list);
        max += list.get(0);
        max += list.get(1);
        System.out.println(max);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {

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

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            list.add(sc.nextInt());
        }
        int k = sc.nextInt();
        int max = Collections.max(list);
        for (int i = 0; i < k; i++) {
            max *= 2;
        }
        Collections.sort(list);
        max += list.get(0);
        max += list.get(1);
        System.out.println(max);
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            list.add(sc.nextInt());
        }
        int k = sc.nextInt();
        int max = Collections.max(list);
        for (int i = 0; i < k; i++) {
            max *= 2;
        }
        Collections.sort(list);
        max += list.get(0);
        max += list.get(1);
        System.out.println(max);
    }
}