import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int c = Integer.parseInt(s[2]);
		int k = Integer.parseInt(vd.readLine());
		int sum=0;
		if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		}
		System.out.println(sum);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int c = Integer.parseInt(s[2]);
		int k = Integer.parseInt(vd.readLine());
		int sum=0;
		if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int c = Integer.parseInt(s[2]);
		int k = Integer.parseInt(vd.readLine());
		int sum=0;
		if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		}
		System.out.println(sum);
	} main {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int c = Integer.parseInt(s[2]);
		int k = Integer.parseInt(vd.readLine());
		int sum=0;
		if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		}
		System.out.println(sum);
	} BufferedReader vd = new BufferedReader(new InputStreamReader(System.in)); vd new BufferedReader(new InputStreamReader(System.in)) String[] s = vd.readLine().split(" "); s vd.readLine().split(" ") vd.readLine().split vd.readLine() vd.readLine vd " " int a = Integer.parseInt(s[0]); a Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 int b = Integer.parseInt(s[1]); b Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 int c = Integer.parseInt(s[2]); c Integer.parseInt(s[2]) Integer.parseInt Integer s[2] s 2 int k = Integer.parseInt(vd.readLine()); k Integer.parseInt(vd.readLine()) Integer.parseInt Integer vd.readLine() vd.readLine vd int sum=0; sum 0 if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		} (a>=b)&&(a>=c) (a>=b) a b (a>=c) a c {
			sum = (int) (a*Math.pow(2, k) + b + c);
		} sum = (int) (a*Math.pow(2, k) + b + c) sum (int) (a*Math.pow(2, k) + b + c) a*Math.pow(2, k) + b + c a*Math.pow(2, k) a Math.pow(2, k) Math.pow Math 2 k b c if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		} (b>a)&&(b>=c) (b>a) b a (b>=c) b c {
			sum = (int) (b*Math.pow(2, k) + a + c);
		} sum = (int) (b*Math.pow(2, k) + a + c) sum (int) (b*Math.pow(2, k) + a + c) b*Math.pow(2, k) + a + c b*Math.pow(2, k) b Math.pow(2, k) Math.pow Math 2 k a c if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		} (c>a)&&(c>b) (c>a) c a (c>b) c b {
			sum = (int) (c*Math.pow(2, k) + a + b);
		} sum = (int) (c*Math.pow(2, k) + a + b) sum (int) (c*Math.pow(2, k) + a + b) c*Math.pow(2, k) + a + b c*Math.pow(2, k) c Math.pow(2, k) Math.pow Math 2 k a b 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) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int c = Integer.parseInt(s[2]);
		int k = Integer.parseInt(vd.readLine());
		int sum=0;
		if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		}
		System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int c = Integer.parseInt(s[2]);
		int k = Integer.parseInt(vd.readLine());
		int sum=0;
		if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		}
		System.out.println(sum);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split(" ");
		int a = Integer.parseInt(s[0]);
		int b = Integer.parseInt(s[1]);
		int c = Integer.parseInt(s[2]);
		int k = Integer.parseInt(vd.readLine());
		int sum=0;
		if((a>=b)&&(a>=c)) {
			sum = (int) (a*Math.pow(2, k) + b + c);
		}else if((b>a)&&(b>=c)) {
			sum = (int) (b*Math.pow(2, k) + a + c);
		}else if((c>a)&&(c>b)) {
			sum = (int) (c*Math.pow(2, k) + a + b);
		}
		System.out.println(sum);
	}
}
