import java.util.*;

class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
      	int B = Integer.parseInt(sc.next());
      	int C = Integer.parseInt(sc.next());
      	int K = Integer.parseInt(sc.next());
        int[]hako = {A,B,C};
      
      	Arrays.sort(hako);
      int max = hako[2];
      	for(int i=0;i<K;i++){
          max = max *2;
        }
      max = max + hako[0] + hako[1];
      System.out.print(max);
      
      
      
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
      	int B = Integer.parseInt(sc.next());
      	int C = Integer.parseInt(sc.next());
      	int K = Integer.parseInt(sc.next());
        int[]hako = {A,B,C};
      
      	Arrays.sort(hako);
      int max = hako[2];
      	for(int i=0;i<K;i++){
          max = max *2;
        }
      max = max + hako[0] + hako[1];
      System.out.print(max);
      
      
      
    }
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
      	int B = Integer.parseInt(sc.next());
      	int C = Integer.parseInt(sc.next());
      	int K = Integer.parseInt(sc.next());
        int[]hako = {A,B,C};
      
      	Arrays.sort(hako);
      int max = hako[2];
      	for(int i=0;i<K;i++){
          max = max *2;
        }
      max = max + hako[0] + hako[1];
      System.out.print(max);
      
      
      
    } main {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
      	int B = Integer.parseInt(sc.next());
      	int C = Integer.parseInt(sc.next());
      	int K = Integer.parseInt(sc.next());
        int[]hako = {A,B,C};
      
      	Arrays.sort(hako);
      int max = hako[2];
      	for(int i=0;i<K;i++){
          max = max *2;
        }
      max = max + hako[0] + hako[1];
      System.out.print(max);
      
      
      
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int C = Integer.parseInt(sc.next()); C Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[]hako = {A,B,C}; hako {A,B,C} A B C Arrays.sort(hako) Arrays.sort Arrays hako int max = hako[2]; max hako[2] hako 2 for(int i=0;i<K;i++){
          max = max *2;
        } int i=0; int i=0; i 0 i<K i K i++ i++ i {
          max = max *2;
        } {
          max = max *2;
        } max = max *2 max max *2 max 2 max = max + hako[0] + hako[1] max max + hako[0] + hako[1] max + hako[0] + hako[1] max hako[0] hako 0 hako[1] hako 1 System.out.print(max) System.out.print System.out System System.out max String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
      	int B = Integer.parseInt(sc.next());
      	int C = Integer.parseInt(sc.next());
      	int K = Integer.parseInt(sc.next());
        int[]hako = {A,B,C};
      
      	Arrays.sort(hako);
      int max = hako[2];
      	for(int i=0;i<K;i++){
          max = max *2;
        }
      max = max + hako[0] + hako[1];
      System.out.print(max);
      
      
      
    }
}