import java.util.*;
public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);


      int[] data = new int[3];


      for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      }
      int k = sc.nextInt();
      Arrays.sort(data);
      for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      }

      System.out.println(data[0]+data[1]+data[2]);

      }
    } import java.util.*; util.* java public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);


      int[] data = new int[3];


      for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      }
      int k = sc.nextInt();
      Arrays.sort(data);
      for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      }

      System.out.println(data[0]+data[1]+data[2]);

      }
    } Main public static void main(String[]args){
      Scanner sc = new Scanner(System.in);


      int[] data = new int[3];


      for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      }
      int k = sc.nextInt();
      Arrays.sort(data);
      for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      }

      System.out.println(data[0]+data[1]+data[2]);

      } main {
      Scanner sc = new Scanner(System.in);


      int[] data = new int[3];


      for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      }
      int k = sc.nextInt();
      Arrays.sort(data);
      for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      }

      System.out.println(data[0]+data[1]+data[2]);

      } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] data = new int[3]; data new int[3] 3 for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      } int i = 0; int i = 0; i 0 i<3 i 3 i++ i++ i {
        data[i] = sc.nextInt();
      } {
        data[i] = sc.nextInt();
      } data[i] = sc.nextInt() data[i] data i sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc Arrays.sort(data) Arrays.sort Arrays data for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      } int i = 0; int i = 0; i 0 i<k i k i++ i++ i {
        data[2] = data[2]*2;
      } {
        data[2] = data[2]*2;
      } data[2] = data[2]*2 data[2] data 2 data[2]*2 data[2] data 2 2 System.out.println(data[0]+data[1]+data[2]) System.out.println System.out System System.out data[0]+data[1]+data[2] data[0]+data[1]+data[2] data[0] data 0 data[1] data 1 data[2] data 2 String[]args args public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);


      int[] data = new int[3];


      for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      }
      int k = sc.nextInt();
      Arrays.sort(data);
      for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      }

      System.out.println(data[0]+data[1]+data[2]);

      }
    } public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);


      int[] data = new int[3];


      for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      }
      int k = sc.nextInt();
      Arrays.sort(data);
      for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      }

      System.out.println(data[0]+data[1]+data[2]);

      }
    } Main
import java.util.*;
public class Main{
  public static void main(String[]args){
      Scanner sc = new Scanner(System.in);


      int[] data = new int[3];


      for (int i = 0;i<3 ;i++ ) {
        data[i] = sc.nextInt();
      }
      int k = sc.nextInt();
      Arrays.sort(data);
      for (int i = 0;i<k ;i++ ) {
        data[2] = data[2]*2;
      }

      System.out.println(data[0]+data[1]+data[2]);

      }
    }
