import java.lang.reflect.Array;
import java.util.*;
import java.lang.*;

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 = a;
        int maxi = 1;
        if (max < b) {
            max = b;
            maxi = 2;
        }
        if (max < c) {
            max = c;
            maxi = 3;
        }
        if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        }
    }
} import java.lang.reflect.Array; Array java.lang.reflect import java.util.*; util.* java import java.lang.*; lang.* java 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 = a;
        int maxi = 1;
        if (max < b) {
            max = b;
            maxi = 2;
        }
        if (max < c) {
            max = c;
            maxi = 3;
        }
        if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        }
    }
} 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 = a;
        int maxi = 1;
        if (max < b) {
            max = b;
            maxi = 2;
        }
        if (max < c) {
            max = c;
            maxi = 3;
        }
        if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        }
    } 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 = a;
        int maxi = 1;
        if (max < b) {
            max = b;
            maxi = 2;
        }
        if (max < c) {
            max = c;
            maxi = 3;
        }
        if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        }
    } 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 = a; max a int maxi = 1; maxi 1 if (max < b) {
            max = b;
            maxi = 2;
        } max < b max b {
            max = b;
            maxi = 2;
        } max = b max b maxi = 2 maxi 2 if (max < c) {
            max = c;
            maxi = 3;
        } max < c max c {
            max = c;
            maxi = 3;
        } max = c max c maxi = 3 maxi 3 if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        } maxi == 1 maxi 1 {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } System.out.println((int)(a * Math.pow(2, k) + b + c)) System.out.println System.out System System.out (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 (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        } maxi == 2 maxi 2 {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } System.out.println((int)(b * Math.pow(2, k) + a + c)) System.out.println System.out System System.out (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 {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        } System.out.println((int)(c * Math.pow(2, k) + b + a)) System.out.println System.out System System.out (int)(c * Math.pow(2, k) + b + a) c * Math.pow(2, k) + b + a c * Math.pow(2, k) c Math.pow(2, k) Math.pow Math 2 k b a 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 = a;
        int maxi = 1;
        if (max < b) {
            max = b;
            maxi = 2;
        }
        if (max < c) {
            max = c;
            maxi = 3;
        }
        if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        }
    }
} 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 = a;
        int maxi = 1;
        if (max < b) {
            max = b;
            maxi = 2;
        }
        if (max < c) {
            max = c;
            maxi = 3;
        }
        if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        }
    }
} Main
import java.lang.reflect.Array;
import java.util.*;
import java.lang.*;

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 = a;
        int maxi = 1;
        if (max < b) {
            max = b;
            maxi = 2;
        }
        if (max < c) {
            max = c;
            maxi = 3;
        }
        if (maxi == 1) {
            System.out.println((int)(a * Math.pow(2, k) + b + c));
        } else if (maxi == 2) {
            System.out.println((int)(b * Math.pow(2, k) + a + c));
        } else {
            System.out.println((int)(c * Math.pow(2, k) + b + a));
        }
    }
}