import 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();

    sc.close();

    if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= 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);
    
  }

} import java.util.*; util.* 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();

    sc.close();

    if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= 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);
    
  }

} 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();

    sc.close();

    if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= 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);
    
  } main {

    Scanner sc = new Scanner(System.in);
    
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int K = sc.nextInt();

    sc.close();

    if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= 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);
    
  } 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 sc.close() sc.close sc if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= B) {
      for (int i = 0; i < K; i++) {
        B = B * 2;
      }
    } else {
      for (int i = 0; i < K; i++) {
        C = C * 2;
      }
    } C <= B && B <= A C <= B C B B <= A B 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 (C <= B && A <= B) {
      for (int i = 0; i < K; i++) {
        B = B * 2;
      }
    } else {
      for (int i = 0; i < K; i++) {
        C = C * 2;
      }
    } C <= B && A <= B C <= B C B A <= B A 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) {

    Scanner sc = new Scanner(System.in);
    
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int K = sc.nextInt();

    sc.close();

    if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= 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);
    
  }

} 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();

    sc.close();

    if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= 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);
    
  }

} Main
import 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();

    sc.close();

    if (C <= B && B <= A) {
      for (int i = 0; i < K; i++) {
        A = A * 2;
      }
    } else if (C <= B && A <= 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);
    
  }

}