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

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

	int[] num = new int[3];
	for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	}
	int k = scan.nextInt();

	Arrays.sort(num);
	for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	}

	int sum = 0;
	for(int i = 0; i < 3; i++){
	    sum += num[i];
	}

	System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[] num = new int[3];
	for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	}
	int k = scan.nextInt();

	Arrays.sort(num);
	for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	}

	int sum = 0;
	for(int i = 0; i < 3; i++){
	    sum += num[i];
	}

	System.out.println(sum);
    }
} Main public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[] num = new int[3];
	for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	}
	int k = scan.nextInt();

	Arrays.sort(num);
	for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	}

	int sum = 0;
	for(int i = 0; i < 3; i++){
	    sum += num[i];
	}

	System.out.println(sum);
    } main {
	Scanner scan = new Scanner(System.in);

	int[] num = new int[3];
	for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	}
	int k = scan.nextInt();

	Arrays.sort(num);
	for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	}

	int sum = 0;
	for(int i = 0; i < 3; i++){
	    sum += num[i];
	}

	System.out.println(sum);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] num = new int[3]; num new int[3] 3 for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
	    num[i] = scan.nextInt();
	} {
	    num[i] = scan.nextInt();
	} num[i] = scan.nextInt() num[i] num i scan.nextInt() scan.nextInt scan int k = scan.nextInt(); k scan.nextInt() scan.nextInt scan Arrays.sort(num) Arrays.sort Arrays num for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	} int i = 1; int i = 1; i 1 i <= k i k i++ i++ i {
	    num[2] *= 2;
	} {
	    num[2] *= 2;
	} num[2] *= 2 num[2] num 2 2 int sum = 0; sum 0 for(int i = 0; i < 3; i++){
	    sum += num[i];
	} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
	    sum += num[i];
	} {
	    sum += num[i];
	} sum += num[i] sum num[i] num i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[] num = new int[3];
	for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	}
	int k = scan.nextInt();

	Arrays.sort(num);
	for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	}

	int sum = 0;
	for(int i = 0; i < 3; i++){
	    sum += num[i];
	}

	System.out.println(sum);
    }
} public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[] num = new int[3];
	for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	}
	int k = scan.nextInt();

	Arrays.sort(num);
	for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	}

	int sum = 0;
	for(int i = 0; i < 3; i++){
	    sum += num[i];
	}

	System.out.println(sum);
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

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

	int[] num = new int[3];
	for(int i = 0; i < 3; i++){
	    num[i] = scan.nextInt();
	}
	int k = scan.nextInt();

	Arrays.sort(num);
	for(int i = 1; i <= k; i++){
	    num[2] *= 2;
	}

	int sum = 0;
	for(int i = 0; i < 3; i++){
	    sum += num[i];
	}

	System.out.println(sum);
    }
}
