import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a[]=new int [3];
		a[0]=scan.nextInt();
		a[1]=scan.nextInt();
		a[2]=scan.nextInt();
		int b=scan.nextInt();
		for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		}
		int ans=0;
		for(int i=0;i!=3;i++) {
			ans+=a[i];
		}
		System.out.println(ans);
	}
	} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a[]=new int [3];
		a[0]=scan.nextInt();
		a[1]=scan.nextInt();
		a[2]=scan.nextInt();
		int b=scan.nextInt();
		for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		}
		int ans=0;
		for(int i=0;i!=3;i++) {
			ans+=a[i];
		}
		System.out.println(ans);
	}
	} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a[]=new int [3];
		a[0]=scan.nextInt();
		a[1]=scan.nextInt();
		a[2]=scan.nextInt();
		int b=scan.nextInt();
		for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		}
		int ans=0;
		for(int i=0;i!=3;i++) {
			ans+=a[i];
		}
		System.out.println(ans);
	} main {
		Scanner scan=new Scanner(System.in);
		int a[]=new int [3];
		a[0]=scan.nextInt();
		a[1]=scan.nextInt();
		a[2]=scan.nextInt();
		int b=scan.nextInt();
		for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		}
		int ans=0;
		for(int i=0;i!=3;i++) {
			ans+=a[i];
		}
		System.out.println(ans);
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int a[]=new int [3]; a new int [3] 3 a[0]=scan.nextInt() a[0] a 0 scan.nextInt() scan.nextInt scan a[1]=scan.nextInt() a[1] a 1 scan.nextInt() scan.nextInt scan a[2]=scan.nextInt() a[2] a 2 scan.nextInt() scan.nextInt scan int b=scan.nextInt(); b scan.nextInt() scan.nextInt scan for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		} int i=0; int i=0; i 0 i!=b i b i++ i++ i {
			Arrays.sort(a);
			a[2]*=2;
		} {
			Arrays.sort(a);
			a[2]*=2;
		} Arrays.sort(a) Arrays.sort Arrays a a[2]*=2 a[2] a 2 2 int ans=0; ans 0 for(int i=0;i!=3;i++) {
			ans+=a[i];
		} int i=0; int i=0; i 0 i!=3 i 3 i++ i++ i {
			ans+=a[i];
		} {
			ans+=a[i];
		} ans+=a[i] ans a[i] a i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a[]=new int [3];
		a[0]=scan.nextInt();
		a[1]=scan.nextInt();
		a[2]=scan.nextInt();
		int b=scan.nextInt();
		for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		}
		int ans=0;
		for(int i=0;i!=3;i++) {
			ans+=a[i];
		}
		System.out.println(ans);
	}
	} public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a[]=new int [3];
		a[0]=scan.nextInt();
		a[1]=scan.nextInt();
		a[2]=scan.nextInt();
		int b=scan.nextInt();
		for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		}
		int ans=0;
		for(int i=0;i!=3;i++) {
			ans+=a[i];
		}
		System.out.println(ans);
	}
	} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a[]=new int [3];
		a[0]=scan.nextInt();
		a[1]=scan.nextInt();
		a[2]=scan.nextInt();
		int b=scan.nextInt();
		for(int i=0;i!=b;i++) {
			Arrays.sort(a);
			a[2]*=2;
		}
		int ans=0;
		for(int i=0;i!=3;i++) {
			ans+=a[i];
		}
		System.out.println(ans);
	}
	}
