import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        
        int max = 0;
        if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        }
        
        long newK = (long) Math.pow(2,k);
        
        
        System.out.println(a + b + c + (max * newK));
    }
    
} import java.util.Scanner; Scanner java.util public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        
        int max = 0;
        if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        }
        
        long newK = (long) Math.pow(2,k);
        
        
        System.out.println(a + b + c + (max * newK));
    }
    
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        
        int max = 0;
        if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        }
        
        long newK = (long) Math.pow(2,k);
        
        
        System.out.println(a + b + c + (max * newK));
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        
        int max = 0;
        if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        }
        
        long newK = (long) Math.pow(2,k);
        
        
        System.out.println(a + b + c + (max * newK));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc int max = 0; max 0 if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        } Math.max(a, b) == a && Math.max(a, c) == a Math.max(a, b) == a Math.max(a, b) Math.max Math a b a Math.max(a, c) == a Math.max(a, c) Math.max Math a c a {
        	max = a;
        	a = 0;
        } max = a max a a = 0 a 0 if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        } Math.max(a, b) == b && Math.max(b, c) == b Math.max(a, b) == b Math.max(a, b) Math.max Math a b b Math.max(b, c) == b Math.max(b, c) Math.max Math b c b {
        	max = b;
        	b = 0;
        } max = b max b b = 0 b 0 {
        	max = c;
        	c = 0;
        } max = c max c c = 0 c 0 long newK = (long) Math.pow(2,k); newK (long) Math.pow(2,k) Math.pow Math 2 k System.out.println(a + b + c + (max * newK)) System.out.println System.out System System.out a + b + c + (max * newK) c a + b + c + (max * newK) a b c (max * newK) max newK String[] args args public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        
        int max = 0;
        if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        }
        
        long newK = (long) Math.pow(2,k);
        
        
        System.out.println(a + b + c + (max * newK));
    }
    
} public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        
        int max = 0;
        if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        }
        
        long newK = (long) Math.pow(2,k);
        
        
        System.out.println(a + b + c + (max * newK));
    }
    
} Main
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        
        int max = 0;
        if (Math.max(a, b) == a && Math.max(a, c) == a) {
        	max = a;
        	a = 0;
        } else if (Math.max(a, b) == b && Math.max(b, c) == b) {
        	max = b;
        	b = 0;
        } else {
        	max = c;
        	c = 0;
        }
        
        long newK = (long) Math.pow(2,k);
        
        
        System.out.println(a + b + c + (max * newK));
    }
    
}