import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int [] valuees = new int[3];
        for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        }
        Arrays.sort(valuees);

        int k = Integer.parseInt(input.readLine());
        for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        }
        System.out.println(valuees[0] + valuees[1]+ valuees[2]);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int [] valuees = new int[3];
        for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        }
        Arrays.sort(valuees);

        int k = Integer.parseInt(input.readLine());
        for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        }
        System.out.println(valuees[0] + valuees[1]+ valuees[2]);
    }
} Main public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int [] valuees = new int[3];
        for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        }
        Arrays.sort(valuees);

        int k = Integer.parseInt(input.readLine());
        for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        }
        System.out.println(valuees[0] + valuees[1]+ valuees[2]);
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int [] valuees = new int[3];
        for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        }
        Arrays.sort(valuees);

        int k = Integer.parseInt(input.readLine());
        for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        }
        System.out.println(valuees[0] + valuees[1]+ valuees[2]);
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) StringTokenizer tokenizer = new StringTokenizer(input.readLine()); tokenizer new StringTokenizer(input.readLine()) int [] valuees = new int[3]; valuees new int[3] 3 for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        } {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        } valuees[i] = Integer.parseInt(tokenizer.nextToken()) valuees[i] valuees i Integer.parseInt(tokenizer.nextToken()) Integer.parseInt Integer tokenizer.nextToken() tokenizer.nextToken tokenizer Arrays.sort(valuees) Arrays.sort Arrays valuees int k = Integer.parseInt(input.readLine()); k Integer.parseInt(input.readLine()) Integer.parseInt Integer input.readLine() input.readLine input for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        } int i = 0; int i = 0; i 0 i < k i k i++ i++ i {
            valuees[2] *= 2;
        } {
            valuees[2] *= 2;
        } valuees[2] *= 2 valuees[2] valuees 2 2 System.out.println(valuees[0] + valuees[1]+ valuees[2]) System.out.println System.out System System.out valuees[0] + valuees[1]+ valuees[2] valuees[0] + valuees[1]+ valuees[2] valuees[0] valuees 0 valuees[1] valuees 1 valuees[2] valuees 2 String[] args args public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int [] valuees = new int[3];
        for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        }
        Arrays.sort(valuees);

        int k = Integer.parseInt(input.readLine());
        for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        }
        System.out.println(valuees[0] + valuees[1]+ valuees[2]);
    }
} public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int [] valuees = new int[3];
        for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        }
        Arrays.sort(valuees);

        int k = Integer.parseInt(input.readLine());
        for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        }
        System.out.println(valuees[0] + valuees[1]+ valuees[2]);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int [] valuees = new int[3];
        for (int i = 0; i < 3; i++) {
            valuees[i] = Integer.parseInt(tokenizer.nextToken());
        }
        Arrays.sort(valuees);

        int k = Integer.parseInt(input.readLine());
        for (int i = 0; i < k; i++) {
            valuees[2] *= 2;
        }
        System.out.println(valuees[0] + valuees[1]+ valuees[2]);
    }
}
