import java.math.*;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		}
	}
}
 import java.math.*; math.* java import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		}
	}
} Main public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		}
	} main {
		Scanner cin = new Scanner(System.in);
		while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		}
	} Scanner cin = new Scanner(System.in); cin new Scanner(System.in) while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		} cin.hasNext() cin.hasNext cin {
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		} int a = cin.nextInt(); a cin.nextInt() cin.nextInt cin int b = cin.nextInt(); b cin.nextInt() cin.nextInt cin int c = cin.nextInt(); c cin.nextInt() cin.nextInt cin int k = cin.nextInt(); k cin.nextInt() cin.nextInt cin int maxn = Math.max(Math.max(a, b),c); maxn Math.max(Math.max(a, b),c) Math.max Math Math.max(a, b) Math.max Math a b c int sum = a+b+c-maxn; sum a+b+c-maxn a+b+c a+b+c a b c maxn for(int i=1;i<=k;++i){
				maxn *= 2;
			} int i=1; int i=1; i 1 i<=k i k ++i ++i i {
				maxn *= 2;
			} {
				maxn *= 2;
			} maxn *= 2 maxn 2 sum += maxn sum maxn 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 cin = new Scanner(System.in);
		while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		}
	}
} Main
import java.math.*;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(cin.hasNext()){
			int a = cin.nextInt();
			int b = cin.nextInt();
			int c = cin.nextInt();
			int k = cin.nextInt();
			int maxn = Math.max(Math.max(a, b),c);
			int sum = a+b+c-maxn;
			for(int i=1;i<=k;++i){
				maxn *= 2;
			}
			sum += maxn;
			System.out.println(sum);
		}
	}
}

