import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    int k = sc.nextInt();

    if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    }

    

   

    

    




    







}
} import java.io.BufferedReader; BufferedReader java.io import java.io.*; io.* java import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Collections; Collections java.util import java.util.Arrays; Arrays java.util public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    int k = sc.nextInt();

    if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    }

    

   

    

    




    







}
} Main public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    int k = sc.nextInt();

    if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    }

    

   

    

    




    







} main {
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    int k = sc.nextInt();

    if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    }

    

   

    

    




    







} final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final List<Integer> list = new ArrayList<>(); list new ArrayList<>() final List<Integer> list2 = new ArrayList<>(); list2 new ArrayList<>() long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long c = sc.nextLong(); c sc.nextLong() sc.nextLong sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    } Math.max(Math.max(a,b),c) == a Math.max(Math.max(a,b),c) Math.max Math Math.max(a,b) Math.max Math a b c a {
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    } for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        } int i = 0 ; int i = 0 ; i 0 i < k i k i++ i++ i {
            a = 2 * a;
        } {
            a = 2 * a;
        } a = 2 * a a 2 * a 2 a System.out.println(a + b + c) System.out.println System.out System System.out a + b + c a + b + c a b c if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    } Math.max(Math.max(a,b),c) == b Math.max(Math.max(a,b),c) Math.max Math Math.max(a,b) Math.max Math a b c b {
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    } for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        } int i = 0 ; int i = 0 ; i 0 i < k i k i++ i++ i {
            b = 2 * b;
        } {
            b = 2 * b;
        } b = 2 * b b 2 * b 2 b System.out.println(a + b + c) System.out.println System.out System System.out a + b + c a + b + c a b c {
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    } for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        } int i = 0 ; int i = 0 ; i 0 i < k i k i++ i++ i {
            c = 2 * c;
        } {
            c = 2 * c;
        } c = 2 * c c 2 * c 2 c System.out.println(a + b + c) System.out.println System.out System System.out a + b + c a + b + c a b c final String[] args args public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    int k = sc.nextInt();

    if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    }

    

   

    

    




    







}
} public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    int k = sc.nextInt();

    if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    }

    

   

    

    




    







}
} Main
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = sc.nextLong();
    int k = sc.nextInt();

    if(Math.max(Math.max(a,b),c) == a){
        for(int i = 0 ; i < k ; i++){
            a = 2 * a;
        }
        System.out.println(a + b + c);
    }else if(Math.max(Math.max(a,b),c) == b){
        for(int i = 0 ; i < k ; i++){
            b = 2 * b;
        }
        System.out.println(a + b + c);
    }else{
        for(int i = 0 ; i < k ; i++){
            c = 2 * c;
        }
        System.out.println(a + b + c);
    }

    

   

    

    




    







}
}