import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args){
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
    public static void main(String[] args){
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    }
} Main public static void main(String[] args){
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    } main {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    } InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        } catch(IOException e){
            System.out.println(e);
        } IOException e {
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        } String buf = br.readLine(); buf br.readLine() br.readLine br String str[] = buf.split(" ", 0); str buf.split(" ", 0) buf.split buf " " 0 int a = Integer.parseInt(str[0]); a Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int b = Integer.parseInt(str[1]); b Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int c = Integer.parseInt(str[2]); c Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            } catch(IOException e){
                System.out.println(e);
            } IOException e {
                System.out.println(e);
            } System.out.println(e) System.out.println System.out System System.out e {
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            } String s = br.readLine(); s br.readLine() br.readLine br String tmp[] = s.split(" ", 0); tmp s.split(" ", 0) s.split s " " 0 int k = Integer.parseInt(tmp[0]); k Integer.parseInt(tmp[0]) Integer.parseInt Integer tmp[0] tmp 0 if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                } b <= a && c <= a b <= a b a c <= a c a {
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                } for(int i=0; i<k; i++){
                        a = a * 2;
                    } int i=0; int i=0; i 0 i<k i k i++ i++ i {
                        a = a * 2;
                    } {
                        a = a * 2;
                    } a = a * 2 a a * 2 a 2 if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                } a <= b && c <= b a <= b a b c <= b c b {
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                } for(int i=0; i<k; i++){
                        b = b * 2;
                    } int i=0; int i=0; i 0 i<k i k i++ i++ i {
                        b = b * 2;
                    } {
                        b = b * 2;
                    } b = b * 2 b b * 2 b 2 {
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                } for(int i=0; i<k; i++){
                        c = c * 2;
                    } int i=0; int i=0; i 0 i<k i k i++ i++ i {
                        c = c * 2;
                    } {
                        c = c * 2;
                    } c = c * 2 c c * 2 c 2 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){
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    }
} public class Main{
    public static void main(String[] args){
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    }
} Main
import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args){
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);

        try{
            String buf = br.readLine();
            String str[] = buf.split(" ", 0);

            int a = Integer.parseInt(str[0]);
            int b = Integer.parseInt(str[1]);
            int c = Integer.parseInt(str[2]);
            try{
                String s = br.readLine();
                String tmp[] = s.split(" ", 0);
                int k = Integer.parseInt(tmp[0]);

                if(b <= a && c <= a){
                    for(int i=0; i<k; i++){
                        a = a * 2;
                    }
                }
                else if(a <= b && c <= b){
                    for(int i=0; i<k; i++){
                        b = b * 2;
                    }
                }
                else{
                    for(int i=0; i<k; i++){
                        c = c * 2;
                    }
                }
                System.out.println(a+b+c);
            }
            catch(IOException e){
                System.out.println(e);
            }
        }
        catch(IOException e){
            System.out.println(e);
        }
    }
}
