import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer[] abc = new Integer[3];
        for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        sc.close();

        Arrays.sort(abc, Collections.reverseOrder());

        int target = 0;
        for(int i=0; i<k; i++) {
            abc[0] *= 2;
        }
        System.out.println(abc[0] + abc[1] + abc[2]);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer[] abc = new Integer[3];
        for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        sc.close();

        Arrays.sort(abc, Collections.reverseOrder());

        int target = 0;
        for(int i=0; i<k; i++) {
            abc[0] *= 2;
        }
        System.out.println(abc[0] + abc[1] + abc[2]);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer[] abc = new Integer[3];
        for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        sc.close();

        Arrays.sort(abc, Collections.reverseOrder());

        int target = 0;
        for(int i=0; i<k; i++) {
            abc[0] *= 2;
        }
        System.out.println(abc[0] + abc[1] + abc[2]);
    } main {
        Scanner sc = new Scanner(System.in);

        Integer[] abc = new Integer[3];
        for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        sc.close();

        Arrays.sort(abc, Collections.reverseOrder());

        int target = 0;
        for(int i=0; i<k; i++) {
            abc[0] *= 2;
        }
        System.out.println(abc[0] + abc[1] + abc[2]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Integer[] abc = new Integer[3]; abc new Integer[3] 3 for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            abc[i] = sc.nextInt();
        } {
            abc[i] = sc.nextInt();
        } abc[i] = sc.nextInt() abc[i] abc i sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc sc.close() sc.close sc Arrays.sort(abc, Collections.reverseOrder()) Arrays.sort Arrays abc Collections.reverseOrder() Collections.reverseOrder Collections int target = 0; target 0 for(int i=0; i<k; i++) {
            abc[0] *= 2;
        } int i=0; int i=0; i 0 i<k i k i++ i++ i {
            abc[0] *= 2;
        } {
            abc[0] *= 2;
        } abc[0] *= 2 abc[0] abc 0 2 System.out.println(abc[0] + abc[1] + abc[2]) System.out.println System.out System System.out abc[0] + abc[1] + abc[2] abc[0] + abc[1] + abc[2] abc[0] abc 0 abc[1] abc 1 abc[2] abc 2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer[] abc = new Integer[3];
        for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        sc.close();

        Arrays.sort(abc, Collections.reverseOrder());

        int target = 0;
        for(int i=0; i<k; i++) {
            abc[0] *= 2;
        }
        System.out.println(abc[0] + abc[1] + abc[2]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer[] abc = new Integer[3];
        for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        sc.close();

        Arrays.sort(abc, Collections.reverseOrder());

        int target = 0;
        for(int i=0; i<k; i++) {
            abc[0] *= 2;
        }
        System.out.println(abc[0] + abc[1] + abc[2]);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer[] abc = new Integer[3];
        for(int i=0; i<3; i++) {
            abc[i] = sc.nextInt();
        }
        int k = sc.nextInt();
        sc.close();

        Arrays.sort(abc, Collections.reverseOrder());

        int target = 0;
        for(int i=0; i<k; i++) {
            abc[0] *= 2;
        }
        System.out.println(abc[0] + abc[1] + abc[2]);
    }
}
