import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	}
} Main public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	} main {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int a = s.nextInt(); a s.nextInt() s.nextInt s int b = s.nextInt(); b s.nextInt() s.nextInt s int c = s.nextInt(); c s.nextInt() s.nextInt s int k = s.nextInt(); k s.nextInt() s.nextInt s int coefficient = (int) Math.pow(2, k); coefficient (int) Math.pow(2, k) Math.pow Math 2 k if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		} a >= b && a >= c a >= b a b a >= c a c {
			a *= coefficient;
		} a *= coefficient a coefficient if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		} a <= b && b >= c a <= b a b b >= c b c {
			b *= coefficient;
		} b *= coefficient b coefficient if (a <= c && b <= c){
			c *= coefficient;
		} a <= c && b <= c a <= c a c b <= c b c {
			c *= coefficient;
		} c *= coefficient c coefficient System.out.println(a + b + c) System.out.println System.out System System.out a + b + c a + b + c a b c String[] args args public class Main {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	}
} public class Main {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	}
}